Skip to main content

Web Stat Application from CD

2 replies [Last post]
santafen
Offline
Joined: 2005-03-11
Points: 0

I have a possibly rather odd question regarding jnlp.

We are distributing an installer, written entirely in java, that is cross-platform (Windows, Mac, Linux, Solaris). We currently distribute it as an executable jar file, but some team members have complained that their version of Windows (or Linux) assosicates .jar files with an archiver, rather than java, so the .jar file doesn't execute but un-archives.

So I thought maybe I'd try to put the application on the CD wrapped in a web-page and a jnlp, so the user opens the web-page (from cd) and then clicks the 'Install' button and the jnlp fires up the installer.

I can make some of it work, at leat from NetBeans, but I have so far failed utterly to get the web-page-from-cd part to function. I guess I don't know what settings to use.

The jnlp file in question (thanks to NetBeans 5.0) sets the "codebase=$$codebase" which fails every time. So far, I have not found a value for this that will work.

<?xml version="1.0" encoding="UTF-8"?>

SDKInstaller
Sun Microsystems, Inc.

SDK Installer Application

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
evickroy
Offline
Joined: 2004-07-23
Points: 0

As you stated, the "codebase=$$codebase" is your problem. The "$$codebase" is a token that the JnlpDownloadServlet replaces with the codebase at the time of the request.
The "codebase" value is used anywhere in the JNLP file where "href" is used, so you should set it to the root of where your files are located, or possibly leave it blank.

Here is the spec info on the codebase and href entries of the JNLP file:

[pre]
codebase attribute: All relative URLs specified in href attributes in the JNLP file are using this URL as a base.

href attribute: This is a URL pointing to the location of the JNLP file itself.
[/pre]

Hope this helps
Erik

santafen
Offline
Joined: 2005-03-11
Points: 0

Eric,

Thanks for the reply. Unfortunately, I had already read the spec on the codebase, and have tried various incantations without results. I have tried "." and tried leaving it blank, all of which result in an error at runtime.

I am wondering if there is any way to run the jnlp from a directory and not from a web server.

Thanks