aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Web Start" Watch "Java Web Start" New topic
Author

Java Web Start

Dave Johnson
Greenhorn

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:

http://home.comcast.net/~dddjacob/JukeBox.html
http://home.comcast.net/~dddjacob/JukeBox.jnlp
http://home.comcast.net/~dddjacob/JukeBox.jar


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.

Thanks,

Dave
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

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:
<offline=allowed/>
it should be
<offline-allowed/>

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 ]

Steve
Dave Johnson
Greenhorn

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

Thanks,

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Web Start