I am making a Launcher for a game in java but I would like to make the launcher open the game which is in another file . how can I do this ?
I've tryied this:
Process p = Runtime.getRuntime().exec("javaw.exe C:\\SnowRPG\\Game.jar");
but it isn't openning the java program located in C:\SnowRPG\Game.jar.
System.out.println("launching with profil [" + username_field.getText() + "," + password_field.getText() + "]");
try {
Process p = Runtime.getRuntime().exec("javaw.exe d:\\C:\\SnowRPG\\Game.jar");
} catch (IOException e1) {
e1.printStackTrace();
}
it is supposed to open the game located in C:/SnowRPG/Game.jar when I press the button play