LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: BatKid on November 24, 2010, 18:12:49

Title: Using *.pack.lzma files in java webstart application
Post by: BatKid on November 24, 2010, 18:12:49
Hi,

For lwjgl applets, the *.pack.lzma files are way smaller then the plain .jar files, which is great for download speed and such.  Is there a way for java webstart application to use the compressed version as well?

Thanks
Title: Re: Using *.pack.lzma files in java webstart application
Post by: kappa on November 24, 2010, 20:11:09
You can't use the awesomeness of the LWJGL Appletloader with JWS :)

On a serious note, pack200/lzma is not supported by java web start out of the box. You can however use pack200/gz which comes pretty close to pack200/lzma.

If you must use pack200/lzma with JWS the only way I can think that it'd work is if you write a small loader on top of jws (much like how the appletloader works on top of the java plugin) which would start it self from jws and then download and extract the rest of your files. The code is available for Appletloader so you can starting hacking on it to create such a thing (much like what minecraft did).

A better way would be to use GetDown (http://code.google.com/p/getdown/), its an alternative technology to JWS and generally works much better. It has support for pack200/lzma and its pretty stable and actively developed, its also used in many of the big commercial games from Three Rings (http://www.threerings.net/) and Oddlabs (http://oddlabs.com/) so its a further assurance that its a pretty solid tech.
Title: Re: Using *.pack.lzma files in java webstart application
Post by: jediTofu on November 24, 2010, 20:14:10
Quote from: kappa on November 24, 2010, 20:11:09
You can't use the awesomeness of the LWJGL Appletloader with JWS :)

Not even with applet-desc?

http://download.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/syntax.html#applet_desc (http://download.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/syntax.html#applet_desc)
Title: Re: Using *.pack.lzma files in java webstart application
Post by: jediTofu on November 24, 2010, 20:20:03
Also, the JCanyon (http://java.sun.com/j2se/1.4.2/demos/jcanyon/index.html) source code (even though it's outdated) provides a good example of downloading (and in your case then unpacking the lzma) within Web Start.
Title: Re: Using *.pack.lzma files in java webstart application
Post by: kappa on November 24, 2010, 20:27:18
Quote from: jediTofu on November 24, 2010, 20:14:10
Quote from: kappa on November 24, 2010, 20:11:09
You can't use the awesomeness of the LWJGL Appletloader with JWS :)

Not even with applet-desc?

http://download.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/syntax.html#applet_desc (http://download.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/syntax.html#applet_desc)

Yeh that'd work but would lack the awesomeness bit :)
Since the issues with jws are really its initialisation (jnlp files not being setup properly on the system) and download mechanism failing.
Title: Re: Using *.pack.lzma files in java webstart application
Post by: BatKid on November 24, 2010, 20:35:45
Thanks kappa!  I'll experiment with pack.gz and see if the size is acceptable.  Alternatively, I could bundle both the lzma and the gz version so the user can choose the deployment format.