Class JavaLauncher
java.lang.Object
com.ibm.wala.util.processes.Launcher
com.ibm.wala.util.processes.JavaLauncher
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ibm.wala.util.processes.Launcher
Launcher.Drainer
-
Field Summary
Fields inherited from class com.ibm.wala.util.processes.Launcher
env, stdErr, stdOut, workingDir
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static String
@Nullable Process
boolean
void
join()
Wait for the spawned process to terminate.static JavaLauncher
make
(String programArgs, String mainClass, boolean inheritClasspath, List<String> classpathEntries, boolean captureOutput, boolean captureErr, Logger logger) static JavaLauncher
Compute the classpath for the spawned processstatic String
Deprecated.void
setEnableAssertions
(boolean enableAssertions) void
setJavaExe
(String javaExe) void
start()
Launch the java process.toString()
Methods inherited from class com.ibm.wala.util.processes.Launcher
captureStdErr, captureStdOut, drainStdErr, drainStdOut, getEnv, getInput, getStderr, getStdOut, getWorkingDir, isCaptureErr, isCaptureOutput, setEnv, setInput, setStdErr, setStdOut, setWorkingDir, spawnProcess, spawnProcess
-
Method Details
-
make
public static JavaLauncher make(String programArgs, String mainClass, List<String> classpathEntries, Logger logger) - Parameters:
programArgs
- arguments to be passed to the Java programmainClass
- Declaring class of the main() method to run.classpathEntries
- Paths that will be added to the default classpath
-
make
public static JavaLauncher make(String programArgs, String mainClass, boolean inheritClasspath, List<String> classpathEntries, boolean captureOutput, boolean captureErr, Logger logger) - Parameters:
programArgs
- arguments to be passed to the Java programmainClass
- Declaring class of the main() method to run.inheritClasspath
- Should the spawned process inherit all classpath entries of the currently running process?classpathEntries
- Paths that will be added to the default classpathcaptureOutput
- should the launcher capture the stdout from the subprocess?captureErr
- should the launcher capture the stderr from the subprocess?
-
getJavaExe
-
setJavaExe
-
setProgramArgs
-
getProgramArgs
-
getMainClass
-
getXtraClassPath
-
toString
-
defaultJavaExe
- Returns:
- the string that identifies the java executable file
-
start
Launch the java process.- Throws:
IllegalArgumentException
IOException
-
getLastProcess
-
join
public void join()Wait for the spawned process to terminate.- Throws:
IllegalStateException
- if the process has not been started
-
makeClasspath
Compute the classpath for the spawned process -
quoteStringIfNeeded
Deprecated.If the input string contains a space, quote it (for use as a classpath). TODO: Figure out how to make a Mac happy with quotes. Trailing separators are unsafe, so we have to escape the last backslash (if present and unescaped), so it doesn't escape the closing quote. -
isEnableAssertions
public boolean isEnableAssertions() -
setEnableAssertions
public void setEnableAssertions(boolean enableAssertions) -
addVmArg
-
getVmArgs
-