I suggest you use a ProcessBuilder
and start a new JVM.
Here is something to get you started:
ProcessBuilder pb = new ProcessBuilder("/path/to/java", "-jar", "your.jar");
pb.directory(new File("preferred/working/directory"));
Process p = pb.start();
More Related Contents:
- How to get the path of a running JAR file?
- How to make an executable JAR file?
- Running JAR file on Windows
- “Invalid signature file” when attempting to run a .jar
- Execute another jar in a Java program
- What causes “Unable to access jarfile” error?
- Creating runnable JAR with Gradle
- Why is my URI not hierarchical? [duplicate]
- Reference jars inside a jar
- Visual Studio Code, Java Extension, how to add a JAR to classpath?
- NoClassDefFoundError while trying to run my jar with java.exe -jar…what’s wrong?
- Java command line with external .jar
- Creating Runnable Jar with external files included
- “Could not find the main class” error when running jar exported by Eclipse
- How to run a class from Jar which is not the Main-Class in its Manifest file
- Double Clicking JAR file does not open Command Prompt
- How to use a file in a jar as javax.net.ssl.keystore?
- Run a jar File from java program
- How to copy files out of the currently running jar
- Why does my JAR file execute at CMD, but not on double-click?
- Can’t execute jar- file: “no main manifest attribute”
- How to make a JAR file that includes DLL files?
- How to run .jar file by double click on Windows 7 64-bit?
- How to bundle a native library and a JNI library inside a JAR?
- Add image to JAR Java
- Executing a Jar on Vista with a double click
- Cannot find Main Class in File Compiled With Ant
- How do I create an executable fat JAR with Gradle with implementation dependencies?
- I am getting “java.lang.ClassNotFoundException: com.google.gson.Gson” error even though it is defined in my classpath
- How to run a jar file in hadoop?