title: Run java -jar myjar.jar as new thread in java
body: <p>Is any way to run new thread(JVM) in current java program?</p>
  
  <p>Let's say I have program mainApp.jar what will start:
  "java -jar C:/myjar/app1.jar -param 001"
  "java -jar C:/myjar/app2.jar -param 001"
  "java -jar C:/myjar/app3.jar -param 001"</p>
  
  <p>But I need app1, app2, app3 in new thread(new JVM).</p>
  
  <p>For now I try Runtime.getRuntime().exec and ProcessBuilder </p>
  
  <p>1st method: ProcessBuilder</p>
  
  <pre><code>ProcessBuilder pb = new ProcessBuilder("java", "-jar" "C:/myjar/app1.jar -p 001");
                                  pb.inheritIO();
                                  pb.redirectError();
                                  Process ps = pb.start();
  </code></pre>
  
  <p>2nd method: Runtime</p>
  
  <pre><code>                            Process p = Runtime.getRuntime().exec("java -jar app1.jar -i 100",null,new File("C:/myjar"));
                              BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
                              String line = null;
                              while ((line = in.readLine()) != null) {
                                      LOG.info("LOG : " + line);
                              }
  </code></pre>
  
  <p>Both methods works, but they start my app1.jar in the same thread. Is any way to start app1.jar, app2.jar as new JVM?</p>
  
  <p>System: Windows Server 2012,
  IntelliJ Idea 15.0.4</p>