www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: kobeto on September 12, 2004, 12:36:39 am

Title: Error with webstart
Post by: kobeto on September 12, 2004, 12:36:39 am
I have an error when i change to opengl mode on webstart. it says:


no lwjgl in java.library.path

...

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

   at java.lang.ClassLoader.loadLibrary(Unknown Source)

   at java.lang.Runtime.loadLibrary0(Unknown Source)

   at java.lang.System.loadLibrary(Unknown Source)
...

something like that,

and if someone can tell me how i set up webstart so it load files from within the JAR file.   ... is loading from the directories outside the jar ... (/models,/textures etc)

thx ^^
Title: Error with webstart
Post by: EgonOlsen on September 12, 2004, 01:58:24 pm
All i can offer is the jnlp-file that i made for a small jPCT-webstart-demo. It still uses LWJGL-0.8 but that doesn't matter:

(To load the resources from the JARs, you have to use the InputStream-Loaders...there should be a thread around here that shows this IIRC).

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://www.jpct.net/webstart" href="demo4.jnlp">
<information>
<title>jPCT Webstart-demo - verbose</title>
<vendor>jPCT - http://www.jpct.net</vendor>
<homepage href="http://www.www.jpct.net"/>
<description>jPCT Webstart-demo - verbose</description>
<icon href="icon.gif"/>
<icon kind="splash" href="logo.jpg"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.2+" initial-heap-size="64m" max-heap-size="256m"/>
<jar href="demo.jar"/>
<jar href="resources.jar"/>
<jar href="lib/jpct.jar"/>
</resources>
<resources os="Windows">
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.2+"/>
<jar href="lib/lwjgl-0.8/lwjgl.jar"/>
<nativelib href="lib/lwjgl-0.8/lwjgl.zip"/>
</resources>
<resources os="Linux">
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.2+"/>
<jar href="lib/lwjgl-0.8-linux/lwjgl.jar"/>
<nativelib href="lib/lwjgl-0.8-linux/liblwjgl.zip"/>
</resources>
<application-desc main-class="JPCTDemoWS">
<argument>trilinear</argument>
<argument>16bit</argument>
<argument>verbose</argument>
</application-desc>
</jnlp>


Title: Error with webstart
Post by: kobeto on September 14, 2004, 03:59:46 am
ok thank u ^^
Title: Error with webstart
Post by: kobeto on September 14, 2004, 06:44:04 am
i tried and tried ... but how i can use LWJGL work on my webstart game.... pls help me. I get ALWAYS ( +100 times already ... ) the same error: "no lwjgl in java.library.path " i know how to fix this with Eclipse :
"-Djava.library.path=..\..\lib\lwjgl-0.9\ -cp ..\..\lib\lwjgl-0.9\lwjgl.jar" etc ..  but i cant do this on webstart  .... or i can do it? =P i dont know .... pls help me ! XD.... maybe is the manifest? maybe the .classpath on the jar? ...
 
Thanks for your time ^^ .
And sorry for the bother.
Title: Error with webstart
Post by: EgonOlsen on September 14, 2004, 07:45:19 am
Hmm...this section of the jnlp should fix the problem:
Code: [Select]
<nativelib href="lib/lwjgl-0.8/lwjgl.zip"/>
I don't know why it doesn't in your case. Please post your jnlp-file and try if my attempt works for you: http://www.jpct.net/webstart/demo4.jnlp
And try to empty your webstart-directory using the option webstart provides for this. Sometimes, it simply doesn't reload the jnlp the way it should.
Title: Error with webstart
Post by: kobeto on September 14, 2004, 01:47:02 pm
mmm.... dont works ....
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?><jnlp spec="1.0+" codebase="http://kobetoweb.no-ip.com/kobeto/fullmetal" href="fullmetal.jnlp">
<information>
<title>FullMetal jPCT</title>
<vendor>Kobeto</vendor>
<homepage href="http://kobetoweb.no-ip.com"/>
<description>FullMetal</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.2+" initial-heap-size="64m" max-heap-size="256m"/>
<jar href="fm.jar"/>
<jar href="lib/jpct.jar"/>
<jar href="lib/lwjgl.jar"/>
<nativelib href="lib/lwjgl.zip"/>
</resources>
<application-desc main-class="FullMetalTest">
<argument>trilinear</argument>
<argument>16bit</argument>
</application-desc>
</jnlp>
Title: Error with webstart
Post by: EgonOlsen on September 14, 2004, 03:26:30 pm
I took your jnlp, splitted the resources-tag into the global and the os-specific part (I don't think that it really matters, but it's a good idea anyway...loading a dll on linux is pointless). Running it, i got a message that the resources are not signed using the same certificate. Try to re-sign your jars and the zip using the same certificate. Maybe that will work.
Title: Re: Error with webstart
Post by: Anonymous on December 20, 2005, 12:16:09 am
Quote from: "kobeto"
I have an error when i change to opengl mode on webstart. it says:


no lwjgl in java.library.path

...

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

   at java.lang.ClassLoader.loadLibrary(Unknown Source)

   at java.lang.Runtime.loadLibrary0(Unknown Source)

   at java.lang.System.loadLibrary(Unknown Source)
...

something like that,

and if someone can tell me how i set up webstart so it load files from within the JAR file.   ... is loading from the directories outside the jar ... (/models,/textures etc)

thx ^^
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 06:22:36 pm
Same problem.

Anybody help me out?

Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:75)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
   at org.lwjgl.Sys.loadLibrary(Sys.java:84)
   at org.lwjgl.Sys.<clinit>(Sys.java:101)
   at org.lwjgl.opengl.AWTGLCanvas.<clinit>(AWTGLCanvas.java:85)
   at com.threed.jpct.AWTGLRenderer.init(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableGLCanvasRenderer(Unknown Source)
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 07:01:06 pm
When running from webstart or as a stand-alone application?
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 07:13:42 pm
running webstart
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 07:59:22 pm
Maybe you can post the jnlp?
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 08:02:26 pm
following is the jnlp, I just excluded the detail urls and some company information.

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://......" href=".....jnlp">
   <application-desc main-class="com.horse.HorseRunnerMain"/>
   <information>
      <title>...</title>
      <vendor>...</vendor>
      <homepage href="http://......"/>
      <description>...</description>
      <offline-allowed/>
   </information>
   <security>
      <all-permissions/>
   </security>
   <resources>
      <j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
      <jar href="horseracing.jar" main="true"/>
      <jar href="lib/lwjgl_win.jar" />
   </resources>
   <resources os="Windows">
      <j2se version="1.4+"/>
      <nativelib href="lib/lwjgl_win.jar"/>
      <property name="java.library.path" value="."/>
   </resources>
</jnlp>
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 08:05:57 pm
and I found the dll must be put into specified folders to be able to load,
such as C:\WINNT\system32;.;

Can I customized the folders to put the dll file?

lwjgl use "org.lwjgl.Sys.loadLibrary" to load the dll, does that mean the dill must be put in some specified folders?

I remember in java System.load() can load dlls in any path, but System.loadLibrary() only loads the dlls in some specified folders, is it the reason?
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 08:11:31 pm
The dll has to come via webstart. Putting it into system32/whatever is a big no no in either case (webstart or application). What is lwjgl_win.jar in your jnlp? Just the java parts? The native parts too? Try to load the java parts (and only the java parts) in the resources section and the native parts in the resources os=... sections. Just zip the dll and rename it to jar (don't use the zip extension like i did in the jnlp above because i had some problems with Java6 and that extension).
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 08:12:02 pm
Here's how the current Paradroidz-jar is looking:

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://www.jpct.net/para3d2" href="test.jnlp">
<application-desc main-class="naroth.start.StartFrame"/>
<information>
<title>Paradroidz</title>
<vendor>jPCT - http://www.jpct.net</vendor>
<homepage href="http://www.jpct.net/paradroidz"/>
<description>Paradroidz -  a 3d remake of the C64 classic game</description>
<icon href="logo.jpg"/>
<icon kind="splash" href="splash.jpg"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
<jar href="Naroth.jar"/>
<jar href="lib/jpct.jar"/>
<jar href="lib/lwjgl.jar"/>
<jar href="lib/lwjgl_util.jar"/>
</resources>
<resources os="Windows">
<j2se version="1.4+"/>
<nativelib href="lib/lwjgl_win.jar"/>
<property name="java.library.path" value="." />
</resources>
<resources os="Linux" arch="i386">
<j2se version="1.4+"/>
<nativelib href="lib/lwjgl_linux.jar"/>
<property name="java.library.path" value="." />
</resources>
  <resources os="Mac OS X">
<j2se version="1.4+"/>
    <nativelib href="lib/lwjgl_osx.jar"/>
<property name="java.library.path" value="." />
  </resources>
</jnlp>


Title: Error with webstart
Post by: qjvictor on December 20, 2006, 08:56:00 pm
I did as you told.

But a strange thing happens.

In jdk1.5, it is fine, but in jdk1.4, still can't find the dll.
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 08:58:55 pm
Try it without the

<property name="java.library.path" value="." />

thing for Java1.4. I remember that i had to add this for 1.5. Maybe it causes trouble with 1.4? I can't test it ATM, no Java 1.4 on this machine. But at work, i'm still using Java1.4 and my jnlp works fine there...well, you never know. Just give it a try.
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 09:27:36 pm
after remove that line, it is still not working in jdk1.4

I am crazy about this issue.
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 09:29:30 pm
How's the jnlp looking now?
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 09:31:32 pm
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://......" href=".....jnlp">
<application-desc main-class="com.horse.HorseRunnerMain"/>
<information>
<title>...</title>
<vendor>...</vendor>
<homepage href="http://......"/>
<description>...</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
<jar href="horseracing.jar" main="true"/>
</resources>
<resources os="Windows">
<j2se version="1.4+"/>
<nativelib href="lib/lwjgl_win.jar"/>
</resources>
</jnlp>
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 09:35:56 pm
That's not what i suggested. Try to change this part:

Code: [Select]
<resources>
   <j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
   <jar href="horseracing.jar" main="true"/>
</resources>
<resources os="Windows">
   <j2se version="1.4+"/>
   <nativelib href="lib/lwjgl_win.jar"/>
</resources>


to something like this:

Code: [Select]
<resources>
   <j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
   <jar href="horseracing.jar" main="true"/>
   <jar href="lwjgl.jar"/>
</resources>
<resources os="Windows">
   <j2se version="1.4+"/>
   <nativelib href="lib/lwjgl_win.jar"/>
   <property name="java.library.path" value="." />
</resources>


Where lwjgl.jar is the plain and simple lwjgl.jar containing the java-parts of lwjgl and lwjgl_win.jar is a renamed .zip containing all the dlls needed.
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 09:44:58 pm
already tried. doesn't work in jdk1.4, even remove the property line

Code: [Select]
  <resources>
      <j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
      <jar href="horseracing.jar" main="true"/>
      <jar href="lib/lwjgl.jar"/>
      <jar href="lib/lwjgl_util.jar"/>
   </resources>
   <resources os="Windows">
      <j2se version="1.4+"/>
      <nativelib href="lib/lwjgl_win.jar"/>
      <property name="java.library.path" value="." />
   </resources>
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 09:48:36 pm
Does Paradroidz work in your 1.4 installation? http://www.jpct.net/para3d2/test.jnlp
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 09:53:45 pm
Yes, it works.
what's the code of the transferring the dll to local machine?
following is my code:
Code: [Select]
String home="C:/ampm/player";
     try {
         String base=servletPath+"/client/player/";
         byte[] dll=new Transferer(base+"lwjgl.dll").transfer();
         File file=new File(home);
         file.mkdirs();
         file=new File(home+"/lwjgl.dll");
         OutputStream out=new FileOutputStream(file);
         out.write(dll,0,dll.length);
         out.close();
      } catch(Exception e) {
         e.printStackTrace();
      }

Should I use System.load or something else to load the dll?

The Paradroidz  will pass the dll to the client, right?
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 10:00:52 pm
:?: There's no need to transfer the dll in your code when using webstart. Just put it in the native section of the jnlp and webstart will take care of it. Write your application as if there is no dll (i.e. it's just specified at startup via the library.path), don't try to copy the dll around manually.
Title: Error with webstart
Post by: qjvictor on December 20, 2006, 10:02:31 pm
ok, I will have a try.
tell you the result.

Could you give me a code slip which use java.library.path at the starting?
Title: Error with webstart
Post by: EgonOlsen on December 20, 2006, 10:29:48 pm
No code has be written for this. Just start your application with that parameter. For example, Paradroidz as an application starts like this:

Code: [Select]
java -Xmx256m -cp lib\jpct.jar;lib\lwjgl.jar;lib\lwjgl_util.jar;bin\Naroth.jar -Djava.library.path=lib naroth.start.StartFrame

All native parts (dlls for Windows, bins for Linux etc) are in that lib-directory. That's all. No code has to be written here. In webstart, just give the jar containing the native part for the underlying platform like the given jnlp already does and you are done.
Title: Error with webstart
Post by: EgonOlsen on December 21, 2006, 09:46:23 am
And? Given up?  :wink: