2

I'm trying to run my java program with 2 external libraries ( lwjgl.jar and slick-util.jar )

compiling worked fine

but when i run with the following command:

java -cp bin;.;lib/lwjgl.jar;lib/slick-util.jar; Game

I get the following Exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
tshepang
  • 12,111
  • 21
  • 91
  • 136
Tomato
  • 336
  • 5
  • 19
  • Did you do a search before you posted? See this [post](http://stackoverflow.com/questions/6588799/when-i-run-the-jar-i-get-a-no-lwjgl-in-java-library-path-error) – Reimeus Aug 01 '13 at 08:55
  • You're not including the path to where the lwjgl binaries are in the launch parameters. `-Djava.library.path="path/to/lwjgl"`. – Bryan Abrams Aug 01 '13 at 08:56
  • Yes, I've searched. But that isn't exactly my problem. I don't use any IDE and i'm trying to run it in the windows console. At @BryanAbrams: SO i have to add `-Djava.library.path="path/to/lwjgl.jar"´ but where exactly in the command? – Tomato Aug 01 '13 at 08:58
  • @Tomato There should be a DLL (or `.so`) that comes with `lwjgl` set the `java.library.path` to its location – Reimeus Aug 01 '13 at 09:03
  • @Reimeus @BryanAbrams Okay my current command is `java -cp bin;.;lib/lwjgl.jar;lib/slick-util.jar; -Djava.library.path="D:\dev\LWJGL\lwjgl-2.9.0\native\windows\lwjgl.dll" Game` Still same error – Tomato Aug 01 '13 at 09:07

1 Answers1

2

Okay my current command is:

java -cp bin;.;lib/lwjgl.jar;lib/slick-util.jar; 
    -Djava.library.path="D:\dev\LWJGL\lwjgl-2.9.0\native\windows\lwjgl.dll"

Change that to:

java -cp bin;.;lib/lwjgl.jar;lib/slick-util.jar; 
    -Djava.library.path="D:\dev\LWJGL\lwjgl-2.9.0\native\windows"

The -Djava.library.path is a search path; i.e. a list of places to look for the lwjgl.dll file.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • Oh my god, @Stephen C you just saved my world :p. My command is now `java -cp bin;.;lib/lwjgl.jar;lib/slick-util.jar; -Djava.library.path="D:\dev\LWJGL\lwjgl-2.9.0\native\windows" Game` and it works. – Tomato Aug 01 '13 at 09:18
  • I'm not your god. I refuse to take that responsibility :-). – Stephen C Aug 01 '13 at 09:28