1

I currently have a jar that needs the -Djava.library.path to be set for LWJGL on launch or it will throw an UnsatisfiedLinkError. To negate this problem, I have launched the jar through CMD with that VM argument using a batch file (Windows).

My question is - is there any way to do this natively in the jar without requiring some kind of launcher?

AlBlue
  • 23,254
  • 14
  • 71
  • 91
Syd Lambert
  • 1,415
  • 14
  • 16
  • Probable duplicate of: http://stackoverflow.com/questions/2937406/how-to-bundle-a-native-library-and-a-jni-library-inside-a-jar – KevinO Apr 19 '16 at 23:28

1 Answers1

1

You can set the properties inside your program. Use either

System.setProperty("org.lwjgl.librarypath", "path/to/natives");

or

Configuration.LIBRARY_PATH.set("path/to/natives");

at the start of your main method.

javac
  • 2,431
  • 4
  • 17
  • 26