Package org.eclipse.jdt.launching
Class VMRunnerConfiguration
- java.lang.Object
-
- org.eclipse.jdt.launching.VMRunnerConfiguration
-
public class VMRunnerConfiguration extends Object
Holder for various arguments passed to a VM runner. Mandatory parameters are passed in the constructor; optional arguments, via setters.Clients may instantiate this class.
- Restriction:
- This class is not intended to be sub-classed by clients.
-
-
Constructor Summary
Constructors Constructor Description VMRunnerConfiguration(String classToLaunch, String[] classPath)Creates a new configuration for launching a VM to run the given main class using the given class path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getBootClassPath()Returns the boot classpath.String[]getClassPath()Returns the classpath.StringgetClassToLaunch()Returns the name of the class to launch.String[]getEnvironment()Returns the environment for the Java program ornullStringgetModuleDescription()Returns the ModuleDescription.String[]getModulepath()Returns the Modulepath.StringgetOverrideDependencies()Gets the fOverrideDependencies.String[]getProgramArguments()Returns the arguments to the Java program.String[]getVMArguments()Returns the arguments to the VM itself.Map<String,Object>getVMSpecificAttributesMap()Returns theMapthat contains String name/value pairs that represent VM-specific attributes.StringgetWorkingDirectory()Returns the working directory of a launched VM.booleanisMergeOutput()Gets the fMergeOutput.booleanisPreviewEnabled()Gets the fPreviewEnabled.booleanisResumeOnStartup()Returns whether the VM is resumed on startup when launched in debug mode.voidsetBootClassPath(String[] bootClassPath)Sets the boot classpath.voidsetEnvironment(String[] environment)Sets the environment for the Java program.voidsetMergeOutput(boolean fMergeOutput)Sets the fMergeOutput.voidsetModuleDescription(String fModuleDescription)Sets the fModuleDescription.voidsetModulepath(String[] modulepath)Sets the modulepath.voidsetOverrideDependencies(String fOverrideDependencies)Sets the fOverrideDependencies.voidsetPreviewEnabled(boolean fPreviewEnabled)Sets the fPreviewEnabled.voidsetProgramArguments(String[] args)Sets the custom program arguments.voidsetResumeOnStartup(boolean resume)Sets whether the VM is resumed on startup when launched in debug mode.voidsetVMArguments(String[] args)Sets the custom VM arguments.voidsetVMSpecificAttributesMap(Map<String,Object> map)Sets theMapthat contains String name/value pairs that represent VM-specific attributes.voidsetWorkingDirectory(String path)Sets the working directory for a launched VM.
-
-
-
Constructor Detail
-
VMRunnerConfiguration
public VMRunnerConfiguration(String classToLaunch, String[] classPath)
Creates a new configuration for launching a VM to run the given main class using the given class path.- Parameters:
classToLaunch- The fully qualified name of the class to launch. May not be null.classPath- The classpath. May not be null.
-
-
Method Detail
-
setVMSpecificAttributesMap
public void setVMSpecificAttributesMap(Map<String,Object> map)
Sets theMapthat contains String name/value pairs that represent VM-specific attributes.- Parameters:
map- theMapof VM-specific attributes.- Since:
- 2.0
-
setVMArguments
public void setVMArguments(String[] args)
Sets the custom VM arguments. These arguments will be appended to the list of VM arguments that a VM runner uses when launching a VM. Typically, these VM arguments are set by the user. These arguments will not be interpreted by a VM runner, the client is responsible for passing arguments compatible with a particular VM runner.- Parameters:
args- the list of VM arguments
-
setProgramArguments
public void setProgramArguments(String[] args)
Sets the custom program arguments. These arguments will be appended to the list of program arguments that a VM runner uses when launching a VM (in general: none). Typically, these VM arguments are set by the user. These arguments will not be interpreted by a VM runner, the client is responsible for passing arguments compatible with a particular VM runner.- Parameters:
args- the list of arguments
-
setEnvironment
public void setEnvironment(String[] environment)
Sets the environment for the Java program. The Java VM will be launched in the given environment.- Parameters:
environment- the environment for the Java program specified as an array of strings, each element specifying an environment variable setting in the format name=value- Since:
- 3.0
-
setBootClassPath
public void setBootClassPath(String[] bootClassPath)
Sets the boot classpath. Note that the boot classpath will be passed to the VM "as is". This means it has to be complete. Interpretation of the boot class path is up to the VM runner this object is passed to.In release 3.0, support has been added for appending and prepending the boot classpath. Generally an
IVMRunnershould use the prepend, main, and append boot classpaths provided. However, in the case that anIVMRunnerdoes not support these options, a complete bootpath should also be specified.- Parameters:
bootClassPath- The boot classpath. An empty array indicates an empty bootpath andnullindicates a default bootpath.
-
getVMSpecificAttributesMap
public Map<String,Object> getVMSpecificAttributesMap()
Returns theMapthat contains String name/value pairs that represent VM-specific attributes.- Returns:
- The
Mapof VM-specific attributes ornull. - Since:
- 2.0
-
getClassToLaunch
public String getClassToLaunch()
Returns the name of the class to launch.- Returns:
- The fully qualified name of the class to launch. Will not be
null.
-
getClassPath
public String[] getClassPath()
Returns the classpath.- Returns:
- the classpath
-
getBootClassPath
public String[] getBootClassPath()
Returns the boot classpath. An empty array indicates an empty bootpath andnullindicates a default bootpath.In 3.0, support has been added for prepending and appending to the boot classpath. The new attributes are stored in the VM specific attributes map using the following keys defined in
IJavaLaunchConfigurationConstants:- ATTR_BOOTPATH_PREPEND
- ATTR_BOOTPATH_APPEND
- ATTR_BOOTPATH
- Returns:
- The boot classpath. An empty array indicates an empty
bootpath and
nullindicates a default bootpath. - See Also:
setBootClassPath(String[]),IJavaLaunchConfigurationConstants
-
getVMArguments
public String[] getVMArguments()
Returns the arguments to the VM itself.- Returns:
- The VM arguments. Default is an empty array. Will not be
null. - See Also:
setVMArguments(String[])
-
getProgramArguments
public String[] getProgramArguments()
Returns the arguments to the Java program.- Returns:
- The Java program arguments. Default is an empty array. Will not be
null. - See Also:
setProgramArguments(String[])
-
getEnvironment
public String[] getEnvironment()
Returns the environment for the Java program ornull- Returns:
- The Java program environment. Default is
null - Since:
- 3.0
-
setWorkingDirectory
public void setWorkingDirectory(String path)
Sets the working directory for a launched VM.- Parameters:
path- the absolute path to the working directory to be used by a launched VM, ornullif the default working directory is to be inherited from the current process- Since:
- 2.0
-
getWorkingDirectory
public String getWorkingDirectory()
Returns the working directory of a launched VM.- Returns:
- the absolute path to the working directory
of a launched VM, or
nullif the working directory is inherited from the current process - Since:
- 2.0
-
setResumeOnStartup
public void setResumeOnStartup(boolean resume)
Sets whether the VM is resumed on startup when launched in debug mode. Has no effect when not in debug mode.- Parameters:
resume- whether to resume the VM on startup- Since:
- 3.0
-
isResumeOnStartup
public boolean isResumeOnStartup()
Returns whether the VM is resumed on startup when launched in debug mode. Has no effect when no in debug mode. Default value istruefor backwards compatibility.- Returns:
- whether to resume the VM on startup
- Since:
- 3.0
-
setModulepath
public void setModulepath(String[] modulepath)
Sets the modulepath.- Parameters:
modulepath- modulepath- Since:
- 3.10
-
getModulepath
public String[] getModulepath()
Returns the Modulepath.- Returns:
- the modulepath
- Since:
- 3.10
-
setModuleDescription
public void setModuleDescription(String fModuleDescription)
Sets the fModuleDescription.- Parameters:
fModuleDescription- fModuleDescription- Since:
- 3.10
-
getModuleDescription
public String getModuleDescription()
Returns the ModuleDescription.- Returns:
- the ModuleDescription
- Since:
- 3.10
-
getOverrideDependencies
public String getOverrideDependencies()
Gets the fOverrideDependencies.- Returns:
- the fOverrideDependencies
- Since:
- 3.10
-
setOverrideDependencies
public void setOverrideDependencies(String fOverrideDependencies)
Sets the fOverrideDependencies.- Parameters:
fOverrideDependencies- the fOverrideDependencies to set- Since:
- 3.10
-
isPreviewEnabled
public boolean isPreviewEnabled()
Gets the fPreviewEnabled.- Returns:
- the fPreviewEnabled
- Since:
- 3.14
-
setPreviewEnabled
public void setPreviewEnabled(boolean fPreviewEnabled)
Sets the fPreviewEnabled.- Parameters:
fPreviewEnabled- the fPreviewEnabled to set- Since:
- 3.14
-
isMergeOutput
public boolean isMergeOutput()
Gets the fMergeOutput.- Returns:
- the fMergeOutput
- Since:
- 3.15
-
setMergeOutput
public void setMergeOutput(boolean fMergeOutput)
Sets the fMergeOutput. Iftruethe VM will be run with redirectErrorStream(true) to merge error and standard output.- Parameters:
fMergeOutput- the fMergeOutput to set- Since:
- 3.15
-
-