I want to embrace a new JVM process from a Java class.
I could use Runtime.getRuntime().exec(...), but this is a very low level api.
I am looking for something that will wrap my Processapi in something more convenient, for example:
MonitoredJavaProcess javaProcess = new MonitoredJavaProcess(MyMainClass.class, "-Xmx1g");
javaProcess.getGcLogStream();
javaProcess.getHeapSizeObserver();
javaProcess.waitForShutdown();
A bit of context on what I'm trying to do: I run JUnit, the taht test suite starts the embedded Jetty server and runs some tests against it. This means that the Jetty server test threads and junit test threads run in the same JVM. I need to run them separately JVM. I could use ant or maven or something external for starup jetty and then run a test suite against it, but that sounds a little redundant for my simple scenario.