Solved

Java Webstart application

Posted on 2011-02-11
10
601 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

734 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