public class JavaProcess extends Object
JavaProcess.ProcessOptions
and
calling runProcess(ProcessOptions)
. For most other use-cases the
static methods provide a convenient shortcut.Modifier and Type | Class and Description |
---|---|
static class |
JavaProcess.ProcessOptions
Options describing a JVM environment.
|
Constructor and Description |
---|
JavaProcess() |
Modifier and Type | Method and Description |
---|---|
static void |
runProcess(Class<?> clz,
String argString)
Run the
main main method of the given class in a new JVM. |
static void |
runProcess(Class<?> clz,
String[] args)
Run the
main main method of the given class in a new JVM. |
static void |
runProcess(Class<?> clz,
String[] jvmArgs,
String[] args)
Run the
main main method of the given class in a new JVM. |
static void |
runProcess(Class<?> clz,
String jvmArgs,
String argString)
Run the
main main method of the given class in a new JVM. |
static void |
runProcess(JavaProcess.ProcessOptions op)
Run the process described by the given
JavaProcess.ProcessOptions in a
separate JVM and wait for it to exit. |
public JavaProcess()
public static void runProcess(Class<?> clz, String[] args) throws ProcessException
main
main method of the given class in a new JVM.
The new JVM has the same classpath as the invoking JVM. No JVM arguments
are set.clz
- the class to runargs
- the arguments to pass to the main methodProcessException
- if an error occurs during execution or the return code is
non-zero.public static void runProcess(Class<?> clz, String argString) throws ProcessException
main
main method of the given class in a new JVM.
The new JVM has the same classpath as the invoking JVM. No JVM arguments
are set.clz
- the class to runargString
- the arguments to pass to the main methodProcessException
- if an error occurs during execution or the return code is
non-zero.public static void runProcess(Class<?> clz, String[] jvmArgs, String[] args) throws ProcessException
main
main method of the given class in a new JVM.
The new JVM has the same classpath as the invoking JVM.clz
- the class to runjvmArgs
- arguments to pass to the JVMargs
- the arguments to pass to the main methodProcessException
- if an error occurs during execution or the return code is
non-zero.public static void runProcess(Class<?> clz, String jvmArgs, String argString) throws ProcessException
main
main method of the given class in a new JVM.
The new JVM has the same classpath as the invoking JVM.clz
- the class to runjvmArgs
- arguments to pass to the JVMargString
- the arguments to pass to the main methodProcessException
- if an error occurs during execution or the return code is
non-zero.public static void runProcess(JavaProcess.ProcessOptions op) throws ProcessException
JavaProcess.ProcessOptions
in a
separate JVM and wait for it to exit.op
- the JavaProcess.ProcessOptions
.ProcessException
- if an error occurs during execution or the return code is
non-zero.