Heres my code please help! I'm making a launcher for my game. I want to be able to launch the game from the launcher but it dosent work.
ProcessBuilder pb = new ProcessBuilder("test.jar","C:/Users/Marcus/Documents/");
try {
pb.directory(new File("C:\\"));
Process p = pb.start();
} catch (IOException e) {
e.printStackTrace();
}
error:
java.io.IOException: Cannot run program "test.jar" (in directory "C:\"): CreateProcess error=2, Cant find the file at java.lang.ProcessBuilder.start(Unknown Source)