LWJGL Webstart

Started by neoskunk, February 22, 2011, 04:25:03

Previous topic - Next topic

neoskunk

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?

Matzon

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>

Matzon

As long as you're not using stuff that needs increased permissions, then its fine to only have the LWJGL files as signed.

neoskunk

Thanks Matzon!

Is the extension a must or can I host the LWJGL files myself and simply put them in the resources tag?

BatKid

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.
Projects: 
   Env3D (http://env3d.org): Learn Java in 3D
   WhaleChat (http://whalechat.com): A 3D social programming experiment

neoskunk

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?

BatKid

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.
Projects: 
   Env3D (http://env3d.org): Learn Java in 3D
   WhaleChat (http://whalechat.com): A 3D social programming experiment

kappa

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).

neoskunk

Thanks guys.  I might be back but I'll mess around with it for a while. :)