0

I'm using LWJGL and OpenGL. My program works in Eclipse, but when I export it I get a java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path.

Can someone help me export the jar with the lwjgl files?

genpfault
  • 51,148
  • 11
  • 85
  • 139
user5074736
  • 138
  • 8
  • possible duplicate of [Can't start .jar file (using LWJGL)](http://stackoverflow.com/questions/6749141/cant-start-jar-file-using-lwjgl) – javac Jul 02 '15 at 18:18

1 Answers1

0

If you looked at LWJGL wiki you would know that you need to define where native libraries are located. In Eclipse you can configure them for every individual JAR file, so it is easy to forget that it is necessary to pass additional arg when running from command line

-Djava.library.path=<lwjgl dir>\native\windows

For instance:

java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar;jar\jinput.jar;c:\some-other.jar -Djava.library.path=native\windows org.lwjgl.test.WindowCreationTest

This example is taken from the wiki page.

However, if you wanted to generate a runnable JAR with these libraries then more work is needed. Look here for some guidance.

Community
  • 1
  • 1
Michał Grzejszczak
  • 2,599
  • 1
  • 23
  • 28