I am making a game in lwjgl, and I exported the jar for it. I put all the natives in the same folder as it, and if you click the jar it runs fine. However, if I do
ProcessBuilder pb = new ProcessBuilder("java", "-Djava.library.path="+pathtonativefolder, "-jar", pathtojar);
Then it doesn't launch. However, when I do
java -Djava.library.path=nativesfolder -jar thejar.jar
It works fine. What's happening? I assume it's not setting the java.library.path correctly.