Package org.eclipse.jdt.launching
Class AbstractVMRunner
- java.lang.Object
-
- org.eclipse.jdt.launching.AbstractVMRunner
-
-
Constructor Summary
Constructors Constructor Description AbstractVMRunner()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidabort(java.lang.String message, java.lang.Throwable exception, int code)Throws a core exception with an error status object built from the given message, lower level exception, and error code.protected java.lang.String[]combineVmArgs(VMRunnerConfiguration configuration, IVMInstall vmInstall)Combines and returns VM arguments specified by the runner configuration, with those specified by the VM install, if any.protected java.lang.Processexec(java.lang.String[] cmdLine, java.io.File workingDirectory)Executes the given command line using the given working directoryprotected java.lang.Processexec(java.lang.String[] cmdLine, java.io.File workingDirectory, java.lang.String[] envp)Executes the given command line using the given working directory and environmentprotected java.lang.Processexec(java.lang.String[] cmdLine, java.io.File workingDirectory, java.lang.String[] envp, boolean mergeOutput)Executes the given command line using the given working directory and environmentprotected java.lang.StringgetCmdLineAsString(java.lang.String[] cmdLine)Returns the given array of strings as a single space-delimited string.protected java.util.Map<java.lang.String,java.lang.String>getDefaultProcessMap()Returns the default process attribute map for Java processes.protected abstract java.lang.StringgetPluginIdentifier()Returns the identifier of the plug-in this VM runner originated from.protected booleanisModular(VMRunnerConfiguration config, IVMInstall vmInstall)Examines the project and install for presence of module and execution support.protected IProcessnewProcess(ILaunch launch, java.lang.Process p, java.lang.String label, java.util.Map<java.lang.String,java.lang.String> attributes)Returns a new process aborting if the process could not be created.protected static java.lang.String[]quoteWindowsArgs(java.lang.String[] cmdLine)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jdt.launching.IVMRunner
run, showCommandLine
-
-
-
-
Method Detail
-
abort
protected void abort(java.lang.String message, java.lang.Throwable exception, int code) throws CoreExceptionThrows a core exception with an error status object built from the given message, lower level exception, and error code.- Parameters:
message- the status messageexception- lower level exception associated with the error, ornullif nonecode- error code- Throws:
CoreException- The exception encapsulating the reason for the abort
-
getPluginIdentifier
protected abstract java.lang.String getPluginIdentifier()
Returns the identifier of the plug-in this VM runner originated from.- Returns:
- plug-in identifier
-
exec
protected java.lang.Process exec(java.lang.String[] cmdLine, java.io.File workingDirectory) throws CoreExceptionExecutes the given command line using the given working directory- Parameters:
cmdLine- the command lineworkingDirectory- the working directory- Returns:
- the
Process - Throws:
CoreException- if the execution fails- See Also:
DebugPlugin.exec(String[], File)
-
exec
protected java.lang.Process exec(java.lang.String[] cmdLine, java.io.File workingDirectory, java.lang.String[] envp) throws CoreExceptionExecutes the given command line using the given working directory and environment- Parameters:
cmdLine- the command lineworkingDirectory- the working directoryenvp- the environment- Returns:
- the
Process - Throws:
CoreException- is the execution fails- Since:
- 3.0
- See Also:
DebugPlugin.exec(String[], File, String[])
-
exec
protected java.lang.Process exec(java.lang.String[] cmdLine, java.io.File workingDirectory, java.lang.String[] envp, boolean mergeOutput) throws CoreExceptionExecutes the given command line using the given working directory and environment- Parameters:
cmdLine- the command lineworkingDirectory- the working directoryenvp- the environmentmergeOutput- iftruethe error stream will be merged with standard output stream and both can be read through the same output stream- Returns:
- the
Process - Throws:
CoreException- is the execution fails- Since:
- 3.15
- See Also:
DebugPlugin.exec(String[], File, String[])
-
quoteWindowsArgs
protected static java.lang.String[] quoteWindowsArgs(java.lang.String[] cmdLine)
- Since:
- 3.11
-
getCmdLineAsString
protected java.lang.String getCmdLineAsString(java.lang.String[] cmdLine)
Returns the given array of strings as a single space-delimited string.- Parameters:
cmdLine- array of strings- Returns:
- a single space-delimited string
-
getDefaultProcessMap
protected java.util.Map<java.lang.String,java.lang.String> getDefaultProcessMap()
Returns the default process attribute map for Java processes.- Returns:
- default process attribute map for Java processes
-
newProcess
protected IProcess newProcess(ILaunch launch, java.lang.Process p, java.lang.String label, java.util.Map<java.lang.String,java.lang.String> attributes) throws CoreException
Returns a new process aborting if the process could not be created.- Parameters:
launch- the launch the process is contained inp- the system process to wraplabel- the label assigned to the processattributes- values for the attribute map- Returns:
- the new process
- Throws:
CoreException- problems occurred creating the process- Since:
- 3.0
-
combineVmArgs
protected java.lang.String[] combineVmArgs(VMRunnerConfiguration configuration, IVMInstall vmInstall)
Combines and returns VM arguments specified by the runner configuration, with those specified by the VM install, if any.- Parameters:
configuration- runner configurationvmInstall- VM install- Returns:
- combined VM arguments specified by the runner configuration and VM install
- Since:
- 3.0
-
isModular
protected boolean isModular(VMRunnerConfiguration config, IVMInstall vmInstall)
Examines the project and install for presence of module and execution support.- Parameters:
config- runner configurationvmInstall- VM install- Returns:
trueif project is a module and uses JRE version 9 or more, orfalseotherwise- Since:
- 3.10
-
-