I want to run a jar file from my java code. I have seen many methods of how to do it but none of them have worked.
try {
File myFile = new File("C:\\Users\\Shayan pc\\Desktop\\AutomatedGameTesting-master\\AutomatedGameTesting-master\\Mario Side-Scroller(Game)\\mario.jar");
if(myFile.exists()){
System.out.println("file found");
}
Desktop.getDesktop().open(myFile);
} catch (IOException ex) {
}
This method hasnt worked either. Any help would be appreciated.