LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: neoskunk on February 22, 2011, 04:25:03

Title: LWJGL Webstart
Post by: neoskunk on February 22, 2011, 04:25:03
On the documentation page I don't see anything for using LWJGL with Java Webstart.  Is there anything funky when doing this? Is it even possible?

I came across another thread that said every Jar must be signed.  Is this true or is it similar to Applets in that only the LWJGL jars and natives must be signed?
Title: Re: LWJGL Webstart
Post by: Matzon on February 22, 2011, 08:41:40
Just create your JNLP file and add lwjgl as an extension:

<extension name="lwjgl" href="http://lwjgl.org/webstart/2.7.1/extension.jnlp" />



<!-- JNLP File for LWJGL Demos -->
<jnlp
  spec="1.0+"
  codebase="http://lwjgl.org/webstart/"
  href="demo.php/examples.spaceinvaders.Game">
  <information>
    <title>LWJGL Demo [examples.spaceinvaders.Game]</title>
    <vendor>LWJGL</vendor>
    <homepage href="http://lwjgl.org/"/>
    <description>Demonstration of LWJGL</description>
    <description kind="short">Technology Preview</description>
    <icon kind="splash" href="logo.png" />
    <offline-allowed/>
  </information>
  <resources>
    <j2se version="1.4+"/>
    <jar href="lwjgl_test.jar" main="true"/>
    <jar href="media.jar"/>
    <extension name="lwjgl" href="http://lwjgl.org/webstart/2.7.1/extension.jnlp" />
  </resources>
  <application-desc main-class="org.lwjgl.examples.spaceinvaders.Game">
    </application-desc>
</jnlp>
Title: Re: LWJGL Webstart
Post by: Matzon on February 22, 2011, 08:42:56
As long as you're not using stuff that needs increased permissions, then its fine to only have the LWJGL files as signed.
Title: Re: LWJGL Webstart
Post by: neoskunk on February 22, 2011, 16:35:00
Thanks Matzon!

Is the extension a must or can I host the LWJGL files myself and simply put them in the resources tag?
Title: Re: LWJGL Webstart
Post by: BatKid on February 22, 2011, 19:23:35
You can host it yourself by adding the following lines:

  <security>
    <all-permissions/>
  </security>

  <resources os="Windows">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+" max-heap-size="128m"/>
    <nativelib href="windows_natives.jar"/>
  </resources>
  <resources os="Linux">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+" max-heap-size="128m"/>
    <nativelib href="linux_natives.jar"/>
  </resources>
  <resources os="Mac">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+" max-heap-size="128m"/>
    <nativelib href="macosx_natives.jar"/>
  </resources>


But you must sign all jars using your own cert.
Title: Re: LWJGL Webstart
Post by: neoskunk on February 22, 2011, 23:02:03
Really? Even though they are already signed with the LWJGL cert?

My website currently has an LWJGL applet on it so I am already hosting the LWJGL jars which are signed.

Also on the subject of webstart what kind of restrictions does it have?  Similar to an applet? Similar to an application?
Title: Re: LWJGL Webstart
Post by: BatKid on February 22, 2011, 23:05:31
Oh right, the jars are already signed.  Not sure if you need to sign all of the jars.  For my application, I need to resign all of them because my own app also needs security permission, and it is not good to mix certs.

In any case, you can probably experiment to find out if you can mix in unsigned jars with signed jars.  As far as the behavior is concerned, your app will act like a java desktop application, not an applet.
Title: Re: LWJGL Webstart
Post by: kappa on February 22, 2011, 23:07:34
yeh you can mix signed and unsigned jars. Only the signed jars will have access to stuff outside the java sandbox, all unsigned jars will be limited to working within the java sandbox.

So yeh its possible to use the pre-signed LWJGL jars with your own games unsigned jars (as long as your game doesn't need access outside the java sandbox).
Title: Re: LWJGL Webstart
Post by: neoskunk on February 22, 2011, 23:46:56
Thanks guys.  I might be back but I'll mess around with it for a while. :)