I have tried the following to detect what libs are needed, and it works great in Eclipse, however I can NOT get this to work as an exported JAR.
System.setProperty("org.lwjgl.librarypath", new File("/lib/native/" + (System.getProperty("os.name").toLowerCase().contains("win") ? "windows" : "linux") + "/").getAbsolutePath());
I have also tried :
The ./
System.setProperty("org.lwjgl.librarypath", new File("./lib/native/" + (System.getProperty("os.name").toLowerCase().contains("win") ? "windows" : "linux") + "/").getAbsolutePath());
Running it on Windows I get the following:
C:\Users\Nanoscape\Desktop>java -jar Rabits.jar
Exception in thread “main” java.lang.UnsatisfiedLinkError: Can’t load library:
C:\Users\Nanoscape\Desktop.\lib\native\windows\lwjgl64.dll
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:87)
at org.lwjgl.Sys.(Sys.java:117)
at org.lwjgl.opengl.Display.(Display.java:135)
at renderEngine.DisplayManager.(DisplayManager.java:13)
at engineTester.RunGame.main(RunGame.java:13)
Which translates to me the code is not working…
It also shows the .\ in the error even if I have the path without the .
Any ideas? It is probably something really simple and I blew over it…
Any help is appreciated!