Solved

Java Webstart application

Posted on 2011-02-11
10
550 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now