Solved

Java Webstart application

Posted on 2011-02-11
10
569 Views
Last Modified: 2012-05-11
Following instructions here:

http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/03-JavaDeployment/JavaDeployment.html

I create an xml file like so:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://developer.apple.com/java/javawebstart/apps/welcome" href="JWS_Demo.jnlp">
  <information>
    <title>My Application</title>
    <vendor>My Company</vendor>
    <homepage href="http://www.mycompany.com" />
    <offline-allowed />
  </information>
  <resources>
    <j2se version="1.5+" />
    <jar href="myjar.jar" />
  </resources>
  <application-desc main-class="mypackage.MyMainClass" />
</jnlp>

The jar file is in the same directory as the xml file.
Now what? How do I start the application?


0
Comment
Question by:allelopath
  • 5
  • 5
10 Comments
 
LVL 5

Expert Comment

by:aciuica
ID: 34873412
Normally you just need to double-click on your jnlp file.
But I think that you should change the codebase attribute - normally to the url where you want to place your jar and jnlp, but if you want tot test it locally you can use codebase="."
0
 
LVL 1

Author Comment

by:allelopath
ID: 34873488
Should this xml file have an extension "xml" or "jnlp"?
0
 
LVL 5

Accepted Solution

by:
aciuica earned 500 total points
ID: 34873502
the extension should be jnlp
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 1

Author Comment

by:allelopath
ID: 34873531
ok. thx.
If I put "." (ie a period) for the codebase, I get this error:
BadFieldException[ The field <jnlp>codebase has an invalid value: .,.]
      at com.sun.javaws.jnl.XMLUtils.getAttributeURL(XMLUtils.java:102)
      at com.sun.javaws.jnl.XMLFormat.parse(XMLFormat.java:121)
      at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:84)
      at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:102)
      at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:127)
      at com.sun.javaws.Main.launchApp(Main.java:408)
      at com.sun.javaws.Main.continueInSecureThread(Main.java:279)
      at com.sun.javaws.Main$1.run(Main.java:117)
      at java.lang.Thread.run(Thread.java:680)
0
 
LVL 5

Expert Comment

by:aciuica
ID: 34873676
You can try to remove this attribute.
0
 
LVL 1

Author Comment

by:allelopath
ID: 34873751
Tried that, on your suggestion. I get this error:

BadFieldException[ The field <jnlp>href has an invalid value: ccs.jnlp,ccs.jnlp]
      at com.sun.javaws.jnl.XMLUtils.getAttributeURL(XMLUtils.java:102)
      at com.sun.javaws.jnl.XMLFormat.parse(XMLFormat.java:139)
      at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:84)
      at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:102)
      at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:127)
      at com.sun.javaws.LaunchDownload.getUpdatedLaunchDesc(LaunchDownload.java:152)
      at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:444)
      at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:256)
      at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:207)
      at com.sun.javaws.Launcher.launch(Launcher.java:124)
      at com.sun.javaws.Main.launchApp(Main.java:447)
      at com.sun.javaws.Main.continueInSecureThread(Main.java:279)
      at com.sun.javaws.Main$1.run(Main.java:117)
      at java.lang.Thread.run(Thread.java:680)
0
 
LVL 5

Expert Comment

by:aciuica
ID: 34873822
ccs.jnlp is the name of your jnlp file?
0
 
LVL 1

Author Comment

by:allelopath
ID: 34873842
yes, sorry, i had just put a generic example up on the first post.
0
 
LVL 1

Author Comment

by:allelopath
ID: 34873955
What would the local ip address of my machine be? (e.g. 192.168.0.1?)
Macbook Pro, OS X 10.6
0
 
LVL 5

Expert Comment

by:aciuica
ID: 34874396
It seems to be a problem with specify MAC OS path for codebase.
I'm sure that somebody else can advise you better here.
My last suggestion is to try to use one absolute Mac foder path for codebase attribute.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JDeveloper 12c for 32 bit 4 84
VB Script to add site to Java Exception List 4 76
tomcat startup error 5 59
type mismatch (Object[] to double[] 4 24
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question