title: How can I start a 'main' in a new process in Java?
body: <p>The question is rather simple. How can I start a main method in another java process? Now I do it like this:</p>
  <pre><code>startOptions = new String[] {&quot;java&quot;, &quot;-jar&quot;, &quot;serverstart.jar&quot;};
  new ProcessBuilder(startOptions).start();
  </code></pre>
  <p>But they asked me to do it not with an external .jar file. The serverstart.jar obviously has a main method, but it it possible to call that main method in another process, without calling the .jar file?</p>
  <p>I'm thinking of something like this:</p>
  <pre><code>new ProcessBuilder(ServerStart.main(startOptions)).start();
  </code></pre>
  <p>But I don't know if anything like that exists.</p>