public final class ProcessRunner extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
printProcessOutput(String processName,
Process process)
Log stdout and stderr for a process
|
static Process |
runClass(Class<?> clazz,
String... args)
Spawn a process running the main method of a specified class
|
static Process |
runClass(Class<?> clazz,
String[] jvmArgs,
String[] programArgs)
Spawn a process running the main method of a specified class with custom JVM args
|
static Process |
runClass(Class<?> clazz,
String[] jvmArgs,
String[] programArgs,
String[] classPath)
Spawn a process running the main method of a specified class with custom JVM args and classpath
|
public static Process runClass(Class<?> clazz, String... args) throws IOException
clazz - The class to executeargs - Any arguments to pass to the processIOException - if there is an error starting the processpublic static Process runClass(Class<?> clazz, String[] jvmArgs, String[] programArgs) throws IOException
clazz - The class to executejvmArgs - Any JVM arguments to pass to the processprogramArgs - Any arguments to pass to the processIOException - if there is an error starting the processpublic static Process runClass(Class<?> clazz, String[] jvmArgs, String[] programArgs, String[] classPath) throws IOException
clazz - The class to executejvmArgs - Any JVM arguments to pass to the processprogramArgs - Any arguments to pass to the processclassPath - Classpath entries for the processIOException - if there is an error starting the processCopyright © 2022. All rights reserved.