File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Java Web Start Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Web Start" Watch "Java Web Start" New topic

Java Web Start

Dave Johnson

Joined: Jul 27, 2008
Posts: 4
I'm working through the book Head First Java and I've some questions on getting the java web start to work.

I have three files on a web site. I'm using the free comcast website for this.

The three files are:

From my understarding of the instruction is that I first open the html file, which accesses the jnlp file. This sets off a process which downloads the jar file to my computer.

The problem I'm having is the jnlp is not starting a process to download the jar file. Instead the jnlp just appears as a text file when I use Mozilla.

I am able to download and run the jar file from Mozilla when I directly access the jar file bypassing the html and jnlp files. If I use IE then the jar file is treated like a zip file and the program never runs.

I'd like some advice to help get the html -> jnlp -> jar sequence to run correctly.


Rob Spoor

Joined: Oct 27, 2005
Posts: 20181

It seems like Mozilla doesn't recognize the MIME type of jnlp, and will therefore use the default, which seems to be text/plain.

How To Ask Questions How To Answer Questions
Steve Luke

Joined: Jan 28, 2003
Posts: 4181

Did you set up the server to define the mime type for a .jnlp file? Some browsers will use extensions only to determine what function to do. Others will use mime-type, and some will use mime-type and when not present, use the extension.

There is also an error in the JNLP file. You have:
it should be

Your main class also doesn't point to a real class in your jar. When I change this line:
<application-desc main-class="JukeBox"/>
to this:
<application-desc main-class="BeatBox"/>
then your application works fine. Here is my final modification of your JNLP that works (hosted from my local machine but pointing to your comcast hosted page):

Note that I had to use my local address for the URL to the JNLP file. You should of course keep your JNLP where it is and change the <jnlp ... href="..."> appropriately.

[ August 02, 2008: Message edited by: Steve Luke ]
[ August 02, 2008: Message edited by: Steve Luke ]

Dave Johnson

Joined: Jul 27, 2008
Posts: 4
Correcting the errors in the jnlp file was the fix.


I agree. Here's the link:
subject: Java Web Start
jQuery in Action, 3rd edition