I have a Java application, an executable Jar. And the Java application starts via the CMD console (java -jar MyApp.jar or javaw MyApp), another CMD console.
import java.io.IOException;
public class StartApplication {
public static void main(String[] args) {
try {
String command = "cmd.exe /k start";
Process process = Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();
}
}
}
That works fine. But how do I start the application from Windows Explorer, with a double click, because the CMD does not open or the program does not start. How can I start the application in Windows Explorer? Using “Open with” and selecting the Java directory does not work. Is there a special configuration I need to make or have I forgotten something I should do beforehand?
This problem feels like I'm a beginner again....