0

I'm working on a game that's using Slick2d library, I'm using Eclipse IDE, 64-bit java 7, on Linux Ubuntu. In IDE i don't have any problems when i run the game (java-7 64-bit is also set for the project), but when i'm trying to run an exported jar, i get the following error:

java.lang.UnsatisfiedLinkError: no jinput-linux64 in java.library.path

I have the natives folder set properly using:

System.setProperty("org.lwjgl.librarypath", "/<my_natives_folder>");

I don't have "no lwjgl in java.library.path" problem, only this, and only when i run the exported jar.

I found some similar problems on the stack, but none of them seems to solve the problem why the game is running without errors in IDE but not from the jar.

Thanks for any help :)

answer42
  • 65
  • 5
  • 1
    Did you try to launch your game with `java -jar path_to_jar.jar -Djava.library.path="path_to_natives_folder"` ? Did you try to use `System.load(String)` or `System.loadLibrary(String)` ? – NiziL Jul 14 '13 at 08:39

1 Answers1

0

JInput classes are loaded up front, so you can't set it as a system property in code, it needs to be set on the command line.

I got round this by having a launcher for application, it sets up all the properties then loads the classes by name from the class loader, not imported. This means that the properties are set up before the classes are loaded and the libraries statically loaded from those classes.

HTH

Endolf
  • 120
  • 9