UnsatisfiedLinkError: no lwjgl in java.library.path

Started by Ketobi, April 21, 2006, 15:58:14

Previous topic - Next topic

Ketobi

Hi,
when i try to run my programm i get the

Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
       ...

I use the current J2EE version on a Kubuntu 5.10 system with the current Eclipse Version.

I tried the following VM arguments:
-Djava.library.path=/home/ketobi/lwjgl/native;
-Djava.library.path=/home/ketobi/lwjgl/native/
-Djava.library.path=/home/ketobi/lwjgl/jar;
-Djava.library.path=/home/ketobi/lwjgl/jar/
-Djava.library.path=/home/ketobi/lwjgl/
-Djava.library.path=/home/ketobi/lwjgl;
none of them work.
But the Files are definitively there, readable, writeable, executable.

My programm was working fine on win xp but not now on Linux, why?
I'm trying now for a week, i asked people in the #eclipse #lwjgl #linux.de irc-channels.
They helped me much, thanks for that but the problem persists.
Please help me!

Fool Running

I think you need both the path to the .jar and the .dll files (/home/ketobi/lwjgl/native and /home/ketobi/lwjgl/jar). Have you tried that?
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

Ketobi

ok i tried it with
-Djava.library.path=/home/ketobi/lwjgl/native;
-Djava.library.path=/home/ketobi/lwjgl/jar;

and

-Djava.library.path=/home/ketobi/lwjgl/native/
-Djava.library.path=/home/ketobi/lwjgl/jar/

but the error is still there

what .dll files? in my native directory are only .so files. is that the error?

WiESi

You have to download lwjgl-win32-0.99.zip. "so"-files are something like DLLs for Linux.

EDIT: Didn't read you have Linux. When you have Linux "so" should be right.

WiESi

miu

As far as I remember you only need the path to native binaries in java.library.path, jars need to be in the classpath.

Why are you using semicolon ";" on Linux? It's a path separator on Windows (where : is used for a drive designation), but in Unix you use : for that. In your case, a simple

-Djava.library.path=/path/to/native

should do (provided everything else is correct). I think I used a relative path there and it worked on Mac and Linux:

-Djava.library.path=native

Ketobi

ok tried it with
-Djava.library.path=/home/ketobi/lwjgl/native
and
-Djava.library.path=native

no effect.

i tried to start the programm with the console (java Start -Djava.library.path=/home/ketobi/lwjgl/native)
and that seems even more messed up. i get:

Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: Start
  at java.lang.VMClassLoader.transformException(java.lang.Class, java.lang.Throwable) (/usr/lib/libgcj.so.6.0.0)
...

miu

Hmm, the java launcher usage is:

java [-options] YourClass [args]

For LWJGL you normally need:

java -cp your:class:path -Djava.library.path=native YourClass

Have a look at examples here:

http://lwjgl.org/installation.php

Sormuras

...still nobody answered there http://lwjgl.org/forum//viewtopic.php?t=1589 - so I try addressing the problems' next step here. A friend of mine almost got my game started on his Mac. Now, there's only one well-known exception left:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/cr/Desktop/R-A-0/native/liblwjgl.jnilib: 
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)
        at org.lwjgl.Sys$1.run(Sys.java:67)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.<clinit>(Sys.java:65)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:104)


Here's the line, which invoked the VM on Tiger:

mac:~/Desktop/R-A-0 cr$ java -classpath .:classes.jar:data.jar:libs.jar -Djava.library.path=native Main


Nothing complicated, but the native library's not found. The path and the working directory seems to be correct and I'm running out of clues. Anybody to the resue?

Cheers,
Christian

miu

Are you trying to run on an Intel Mac by any chance?

Using LWJGL version 0.99 as released will not work on Intel (and produce this error). You'll need to replace LWJGL jars and native libs from a LWJGL game updated for Intel Mac - Puppygames' Titan Attacks is easiest to use.

If it's a PowerPC Mac your paths or library files must be wrong.

Sormuras

Quote from: "miu"Are you trying to run on an Intel Mac by any chance?

Gonna ask him today.

Quote from: "miu"If it's a PowerPC Mac your paths or library files must be wrong.

Double check this.

Thanks for the reply miu!

Sor

Sormuras

miu, true ... it's an Intel-Mac. *sigh* Thanks for the hint!

System - os.arch: "i386"
System - os.name: "Mac OS X"
System - os.version: "10.4.6"

miu

Only trust your System properties! ;) I thought he'd know what machine he had right away... Intels are still quite new and "special" - unfortunately LWJGL 0.99 was released before Intel Macs.

If you want I can post a working Intel Mac LWJGL package somewhere.

Or extract it from Titan Attacks! from www.puppygames.net.

Please note - it "only" does OpenGL and OpenAL at the moment. FMOD and DevIL are not supported yet.

Sormuras

Fine - Titan Attacks! also has the ".app" directory structure I was looking for. Thanks for this hint, again. Does this LWJGL version only work with Intel-Macs? Meaning, we have two packages for MacOS X ... or will the PPC understand the LWJGL bindings that ship with Titan as well?

@OpenGL/AL only: totally fine with me, what else do you need?! :)

Matzon

the release of 1.0 which is _very_ soon - just working out some compilation issues on intel mac with devil - will have a single lwjgl.jnilib file that includes both ppc and i386.

Sormuras

Quote from: "Matzon"the release of 1.0 which is _very_ soon

:twisted: Yehaa!