When I run the .jar, I get a “No lwjgl in java.library.path” error

you have to point the jvm to where the native files are located using a command line parameter -Djava.library.path=”path/to/natives”. You could use a batch (.bat) file to specify this and start your application for you.

Alternatively you can use a tool like JarSplice to create a single executable jar file from all your jars and at the same time include your native files inside it. It automates the tricky part of specifying the natives manually and provides a nicer end user experience.

To use JarSplice just select your game.jar, lwjgl.jar, lwjgl_util.jar, and jinput.jar in the jars tab. Then all the *.dll, *.so, *.dylib and *.jnilib files in the natives tab. Add your main class on the class tab and create the single executable jar.

Leave a Comment