Offline installation with Java Webstart without any web server

Hi!

The title of this topic is strange as Java Webstart is used to install applications through the web but I would love to use it to install offline application. For example, imagine that you want to give a CD with your game to someone. You would like to create an auto-run CD that launches the installation immediately when it is inserted into the CD driver. Currently, it is difficult to do this and I would like to drive it as easier as deploying an application through Java Webstart. Please vote for my RFE here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6737151

Best regards.

You could just package your application into a java installer like http://izpack.org/ its probably simpler and quicker than using jws.

Besides to use jws locally you would probably need to get the jnlp extension recognised as yet another java executable file. Older versions of java (1.4, etc) do not provide this, they barely struggle to get the .jar extension recognised, hence the reason most java installers on windows use the .exe or .bat formats and .sh on linux.

This article contains useful information on using JNLP for an offline installation:
http://today.java.net/pub/a/today/2008/07/10/distributing-web-start-via-cd-rom.html

Thanks. I read this article some weeks ago but I want something easier and more cross-platform.

It seems fine but I like Java Webstart and it would be better to have a standard tool integrated in Java to make applications that could be installed offline.

Nobody voted for my RFE :frowning:

I don’t even know how…

this is what i use for offline testing after i compile and sign my packages


<?xml version="1.0" encoding="utf-8"?>
<!-- Web Start Deployment -->
<jnlp
  spec="1.0+"
  codebase="file:."
  href="TD_OFFLINE.jnlp">
  <information>
    <title>Gauntlet Championships</title>
    <vendor>bobjob</vendor>
    <homepage href="http://users.on.net/~bobjob"/>
    <description>TD Game</description>
    <description kind="short">RTS</description>
    <!--
    <icon kind="splash" href="sign.jpg"/>
    -->
    <shortcut online="true">
      <desktop/>
      <menu submenu="Games"/>
    </shortcut>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+"/>
    <jar href="TD.jar" main="true"/>
    <jar href="resources.jar"/>
    <jar href="jogg-0.0.7.jar"/>
    <jar href="jorbis-0.0.15.jar"/>
    <jar href="lwjgl_util.jar"/>
    <jar href="lwjgl.jar"/>
  </resources>
  <resources os="Windows">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+"/>
    <nativelib href="win32.jar"/>
  </resources>
  <resources os="Linux">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+"/>
    <nativelib href="linux.jar"/>
  </resources>
  <resources os="Mac OS X">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+"/>
    <nativelib href="macosx.jar"/>
  </resources>
  <application-desc/>
</jnlp>

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6737151

Does it work if you have no more internet connection?

codebase=“file:.” seems interesting but not very cross-platform, isn’t it? Please can you add your workaround into my RFE?

I thought that it would be OS independant, and subject to URL standards

Ok. Then, I need to find a way to use it on a CD.

the “file:.” means working directory therefore i assume it would work off a cd.

If you plan to put it on a cd and want it to be platform independant I honestly think a .JAR file is a better idea
or maybe add an extra .bat and other relavent cmd line files for some platforms (just as backup).

but still as long as you include the class path then a .jar should be good enough. with the jnlp there is the extra head ache of having to sign the packages.

The “file:” protocol does not work for installation. You can either install a JWS app directly from the net or start it from an offline tuned jnlp, but you cannot install it from the offline jnlp, because JWS caching only works over http protocol and not via file URLs. What’s even worse is that you can let JWS create a desktop/startmenu icon for you, but starting the app via the icon results in a mainclass not found error…

Then we have a good reason to vote for my RFE. It is not yet possible to write a short XML file to describe how to find the resources to install a Java application offline. What are you waiting for? Nobody has voted for my RFE.

[quote]What are you waiting for?
[/quote]
I don’t see any real practical benefit for (ab?)using JNLP as some kind of cross-platform installer.
I mean, maybe it could work for some rare cases but I see the following problems that would make me not want to use it:

  • JNLP is not guaranteed to start JWS at all (it would depend on java being installed, and the .jnlp extension tied to JWS)
  • If the application needs a specific version of java, you’d need to download it anyway.

Besides, as I see it, JNLP was not meant for installing software (iirc, even the JNLP specs say something as much). It just seems the wrong tool for the job to me.

If I were to distribute a java game on CD, I’d create an installer for the game + a private JRE I tested with. It’s not difficult to do, but makes life a lot easier for your users than having them explained that they need to start the .jnlp file somehow.

I thought about an autorun.

[quote]I thought about an autorun.
[/quote]
Oh I see…
If you want to depend on java being already installed, and if an autorun can start java, than maybe you could make a java based installer (or use an existing one)?