LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Luy on April 30, 2010, 17:01:14

Title: Web Start and LWJGL Extension
Post by: Luy on April 30, 2010, 17:01:14
Hey guys!

I am using the lwjgl extension for my web start application (i.e. I have <extension name="lwjgl" href="http://lwjgl.org/jnlp/extension.php" /> in my jnlp). I have two questions about that:
1) Is
<security>
    <all-permissions/>
</security>

in the .jnlp needed? The demos on the website do not use it, but my application does not run without it...

2) After LWJGL was updated to a new version my old application does not run anmyore:

java.lang.reflect.InvocationTargetException
Caused by: java.lang.LinkageError: Version mismatch: jar version is '21', native libary version is '22'


Can this be avoided somehow? I do not want to make a new release everytime a new version of LWJGL is released.

Thank you.
Title: Re: Web Start and LWJGL Extension
Post by: Luy on May 14, 2010, 16:39:49
Doesn't anyone use web start?
Title: Re: Web Start and LWJGL Extension
Post by: Ciardhubh on May 14, 2010, 17:56:48
Short:
1) Yes
2) No

Long:
1) Yes, because LWJGL loads shared libraries (e.g. DLLs) for OpenGL and OpenAL. Java demands apps that want to do this to request all permissions. The demos do this somewhere in one of the extensions loaded in the initial JNLP.
2) You have to use natives with the same jar version. Always update everything.
Title: Re: Web Start and LWJGL Extension
Post by: Luy on May 14, 2010, 21:52:50
2) Shouldn't be there a way to avoid this? When the devolpment of a game has finished, it is quite unlikely that there will be regular updates. So old games will stop working sooner or later :(
Title: Re: Web Start and LWJGL Extension
Post by: Ciardhubh on May 14, 2010, 22:06:49
Quote from: Luy on May 14, 2010, 21:52:50
2) Shouldn't be there a way to avoid this? When the devolpment of a game has finished, it is quite unlikely that there will be regular updates. So old games will stop working sooner or later :(

There is: write your own JNLP and put it on your own server. By adding <extension name="lwjgl" href="http://lwjgl.org/jnlp/extension.php" /> you become dependant on whatever libraries were uploaded there.

Either write your own extension that you maintain (download http://lwjgl.org/jnlp/extension.php to see how its done) or write a single JNLP that contains everything.

Here's an example how to put everything in a single JNLP with all resources on your server:
http://ciardhubh.de/download/node/18/ML_N_S_E_SS_Demo.jnlp (right-click, download as ...)

When in doubt, the JNLP guides and spec from Sun are always helpful:
http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/contents.html
http://java.sun.com/javase/technologies/desktop/javawebstart/download-spec.html
Title: Re: Web Start and LWJGL Extension
Post by: kappa on May 14, 2010, 22:12:25
exactly, just grab the lwjgl jars and host them yourself.
Title: Re: Web Start and LWJGL Extension
Post by: Luy on May 15, 2010, 16:14:30
Thanks, that works.

By the way, you should include natives for win64 in you ML_N_S_E_SS_Demo otherwise it won't run if only the 64 bit jre is installed.
Title: Re: Web Start and LWJGL Extension
Post by: Ciardhubh on May 15, 2010, 16:48:50
Quote from: Luy on May 15, 2010, 16:14:30
Thanks, that works.

By the way, you should include natives for win64 in you ML_N_S_E_SS_Demo otherwise it won't run if only the 64 bit jre is installed.

Thanks. Guess I used an older version without 64bit support back then. I'll update it ... eventually.