Hello Guest

[SOLVED] LWJGL Classpath - Native Libraries

  • 1 Replies
  • 1932 Views
[SOLVED] LWJGL Classpath - Native Libraries
« on: December 07, 2014, 20:32:25 »
I got this to launch my jar:
Code: [Select]
java -cp gameEngine.jar;lib/lwjgl.jar main.EngineLauncherIt successfully finds lwjgl.jar, but now I don't know how to point Java to the natives. Adding lib/natives/lwjgl.dll doesn't seem to work. Do I need to do this through code and not command line?

I just get an "UnsatisfiedLinkError: No lwjgl in java.library.path".
Code: [Select]
lib/
    natives/
        lwjgl.dll
    lwjgl.jar
Above is my directory structure. How do I add the lwjgl.dll native to the classpath? The following doesn't work:
java -cp gameEngine.jar;lib/lwjgl.jar;lib/natives/lwjgl.dll gameEngine.jar
« Last Edit: December 07, 2014, 22:19:13 by shivshank »

Re: LWJGL Classpath - Native Libraries
« Reply #1 on: December 07, 2014, 22:18:27 »
Oh, I figured it out.

This worked:
java -cp lib/lwjgl.jar;JVA_GameProject.jar -Djava.library.path="lib/natives" main.EngineLauncher

Classpath is for Java Classes (that much I had started to guess, if it wasn't immediately obvious) and java.library.path is for Native Libraries, it appears. The other problem I had had was that I was writing "lib/natives/lwjgl.dll" instead of just the directory; hence why eclipse always only asked for the directory...