public class JkJavaProcess extends JkAbstractProcess<JkJavaProcess>
Modifier and Type | Field and Description |
---|---|
static java.nio.file.Path |
CURRENT_JAVA_EXEC_DIR |
static java.nio.file.Path |
CURRENT_JAVA_HOME |
CURRENT_JAVA_DIR
Modifier | Constructor and Description |
---|---|
protected |
JkJavaProcess() |
protected |
JkJavaProcess(JkJavaProcess other) |
Modifier and Type | Method and Description |
---|---|
JkJavaProcess |
addAgent(java.nio.file.Path agentLib,
java.lang.String agentOption)
Adds the specified agent to the command line.
|
JkJavaProcess |
addJavaOptions(java.util.Collection<java.lang.String> options)
Adds the specified java options to the command line.
|
JkJavaProcess |
addJavaOptions(java.lang.String... options)
Adds the specified java options to the command line.
|
JkJavaProcess |
addJavaOptionsIf(boolean condition,
java.lang.String... options)
Adds the specified Java options to the command line if the given condition is true.
|
JkJavaProcess |
addSystemProperty(java.lang.String key,
java.lang.String value)
Adds a system property to the command line parameters.
|
JkJavaProcess |
copy()
Creates a copy of the current JkJavaProcess instance with the same properties.
|
protected void |
customizeCommand()
Modifies the command and its execution parameters.
|
static JkJavaProcess |
ofJava(java.lang.String className)
Creates a process launching the current JDK java command on the specified class.
|
static JkJavaProcess |
ofJavaJar(java.nio.file.Path jar)
Creates a process launching the current JDK java command to execute the specified jar.
|
static JkJavaProcess |
ofJavaJar(java.nio.file.Path jar,
java.lang.String className)
Creates a process launching the current JDK java command to execute the specified jar.
|
JkJavaProcess |
setClasspath(java.lang.Iterable<java.nio.file.Path> paths)
Convenient method to set classpath option.
|
JkJavaProcess |
setInheritSystemProperties(boolean inheritSystemProperties)
Sets whether the process should inherit system properties from the parent process.
|
addParams, addParams, addParamsAsCmdLine, addParamsAt, addParamsAt, addParamsIf, exec, execAsync, execCmd, execCmdLine, getParamAt, getParams, getWorkingDir, inheritJkLogOptions, isFailOnError, redirectErrorStream, removeParam, run, setCollectStderr, setCollectStdout, setDestroyAtJvmShutdown, setEnv, setFailOnError, setInheritIO, setLogCommand, setLogWithJekaDecorator, setParamAt, setWorkingDir, setWorkingDir, toString
public static final java.nio.file.Path CURRENT_JAVA_HOME
public static final java.nio.file.Path CURRENT_JAVA_EXEC_DIR
protected JkJavaProcess()
protected JkJavaProcess(JkJavaProcess other)
public static JkJavaProcess ofJava(java.lang.String className)
public static JkJavaProcess ofJavaJar(java.nio.file.Path jar, java.lang.String className)
className
- Can be null.public static JkJavaProcess ofJavaJar(java.nio.file.Path jar)
public JkJavaProcess addAgent(java.nio.file.Path agentLib, java.lang.String agentOption)
agentOption
- Can be nullpublic JkJavaProcess addJavaOptions(java.util.Collection<java.lang.String> options)
public JkJavaProcess addJavaOptionsIf(boolean condition, java.lang.String... options)
addJavaOptions(Collection)
public JkJavaProcess addJavaOptions(java.lang.String... options)
addJavaOptions(Collection)
public JkJavaProcess setClasspath(java.lang.Iterable<java.nio.file.Path> paths)
public JkJavaProcess addSystemProperty(java.lang.String key, java.lang.String value)
public JkJavaProcess setInheritSystemProperties(boolean inheritSystemProperties)
public JkJavaProcess copy()
copy
in class JkAbstractProcess<JkJavaProcess>
protected void customizeCommand()
JkAbstractProcess
This method provides a way for subclasses to adjust the process before it is run.
customizeCommand
in class JkAbstractProcess<JkJavaProcess>