I'm running a jar of an application and library jars from lwjgl. I'm creating a java process. It's working on Windows but not on linux. I tried replacing the semicolons with colons but it didn't work, it just said "Main class not found: Application.natives.linux" or something like that. gamePath is the path the application is in. osName is the name of the operating system.
Here's my code:
String jarRunner = String.format("java -Djava.library.path=\"%snatives/" + osName + "\" -cp \"%sjar/lwjgl.jar;%sjar/lwjgl_util.jar;%sjar/jinput.jar;%sjar/slick.jar;%sApplication.jar\" main.Main", gamePath, gamePath, gamePath, gamePath, gamePath, gamePath); Process p = Runtime.getRuntime().exec(jarRunner); InputStream s = p.getErrorStream(); while(true) { if(s.available() > 0) { byte[] bytes = new byte[s.available()]; s.read(bytes); System.out.println(new String(bytes)); } }
How can I make it work on linux?