public class StandardVMType extends AbstractVMInstallType
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ID_STANDARD_VM_TYPE |
static java.lang.String |
MIN_VM_SIZE
The minimal -Xmx size for launching a JVM.
|
| Constructor and Description |
|---|
StandardVMType() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canDetectDefaultSystemLibraries(java.io.File javaHome,
java.io.File javaExecutable)
Return
true if the appropriate system libraries can be found for the
specified java executable, false otherwise. |
java.io.File |
detectInstallLocation()
Tries to detect an installed VM that matches this VM install type.
|
void |
disposeVMInstall(java.lang.String id)
Remove the VM associated with the given id from the set of VMs managed by
this VM type.
|
protected IVMInstall |
doCreateVMInstall(java.lang.String id)
Subclasses should return a new instance of the appropriate
IVMInstall subclass from this method. |
static java.io.File |
findJavaExecutable(java.io.File vmInstallLocation)
Starting in the specified VM install location, attempt to find the 'java' executable
file.
|
static java.util.List<LibraryLocation> |
gatherAllLibraries(java.lang.String[] dirPaths)
Returns a list of all zip's and jars contained in the given directories.
|
protected LibraryInfo |
generateLibraryInfo(java.io.File javaHome,
java.io.File javaExecutable)
Generates library information for the given java executable.
|
protected java.io.File |
getDefaultEndorsedDirectory(java.io.File installLocation)
Returns the default location of the endorsed directory, based on the
given install location.
|
protected java.io.File |
getDefaultExtensionDirectory(java.io.File installLocation)
Returns the default location of the extension directory, based on the given
install location.
|
java.net.URL |
getDefaultJavadocLocation(java.io.File installLocation)
Returns a URL for the default javadoc location of a VM installed at the
given home location, or
null if none. |
static java.net.URL |
getDefaultJavadocLocation(java.lang.String version)
Returns a default Javadoc location for a language version, or
null. |
protected LibraryInfo |
getDefaultLibraryInfo(java.io.File installLocation)
Returns default library information for the given install location.
|
LibraryLocation[] |
getDefaultLibraryLocations(java.io.File installLocation)
Returns a collection of
LibraryLocations that represent the
default system libraries of this VM install type, if a VM was installed
at the given installLocation. |
protected IPath |
getDefaultPackageRootPath()
Returns the package root path
|
protected java.lang.String |
getDefaultRootPath() |
protected IPath |
getDefaultSystemLibrary(java.io.File javaHome)
Return an
IPath corresponding to the single library file containing the
standard Java classes for most VMs version 1.2 and above. |
protected IPath |
getDefaultSystemLibrarySource(java.io.File libLocation)
Returns a path to the source attachment for the given library, or
an empty path if none.
|
protected java.io.File |
getJavaHomeLocation()
Returns the VM install location using the
java.home system
property or null. |
protected LibraryInfo |
getLibraryInfo(java.io.File javaHome,
java.io.File javaExecutable)
Return library information corresponding to the specified install
location.
|
java.lang.String |
getName()
Returns the display name of this VM type.
|
protected java.lang.String |
getVMVersion(java.io.File javaHome,
java.io.File javaExecutable)
Returns the version of the VM at the given location, with the given
executable.
|
protected LibraryInfo |
parseLibraryInfo(IProcess process)
Parses the output from 'LibraryDetector'.
|
protected java.lang.String[] |
parsePaths(java.lang.String paths) |
java.lang.String |
readReleaseVersion(java.io.File javaHome) |
protected void |
setDefaultRootPath(java.lang.String defaultRootPath) |
IStatus |
validateInstallLocation(java.io.File javaHome)
Validates the given location of a VM installation.
|
createVMInstall, findVMInstall, findVMInstallByName, getDefaultVMArguments, getId, getVMInstalls, setInitializationDatapublic static final java.lang.String ID_STANDARD_VM_TYPE
public static final java.lang.String MIN_VM_SIZE
public static java.io.File findJavaExecutable(java.io.File vmInstallLocation)
File object, otherwise return
null.vmInstallLocation - the File location to look inFile for the Java executable or nullpublic java.lang.String getName()
IVMInstallTypeprotected IVMInstall doCreateVMInstall(java.lang.String id)
AbstractVMInstallTypeIVMInstall subclass from this method.doCreateVMInstall in class AbstractVMInstallTypeid - The vm's id. The IVMInstall instance that is created must
return id from its getId() method.
Must not be null.null.protected LibraryInfo getLibraryInfo(java.io.File javaHome, java.io.File javaExecutable)
javaHome - the Java home folderjavaExecutable - the Java executable fileLibraryInfo for the home and executable path or an empty object, never nullprotected boolean canDetectDefaultSystemLibraries(java.io.File javaHome,
java.io.File javaExecutable)
true if the appropriate system libraries can be found for the
specified java executable, false otherwise.javaHome - the Java home folderjavaExecutable - the Java executable filetrue if the default system libraries can be detected for the given install location
false otherwiseprotected java.lang.String getVMVersion(java.io.File javaHome,
java.io.File javaExecutable)
javaHome - the Java home folderjavaExecutable - the Java executable filepublic java.io.File detectInstallLocation()
IVMInstallTypenull if they
can't assure that a given vm install matches this IVMInstallType.null if unable
to locate an installed VM.protected java.io.File getJavaHomeLocation()
java.home system
property or null.java.home system property, or null if not foundprotected IPath getDefaultSystemLibrary(java.io.File javaHome)
IPath corresponding to the single library file containing the
standard Java classes for most VMs version 1.2 and above.javaHome - the Java home folderIPath to the rt.jar fileprotected IPath getDefaultSystemLibrarySource(java.io.File libLocation)
libLocation - the File location of the library to find the source forprotected IPath getDefaultPackageRootPath()
public LibraryLocation[] getDefaultLibraryLocations(java.io.File installLocation)
IVMInstallTypeLibraryLocations that represent the
default system libraries of this VM install type, if a VM was installed
at the given installLocation.
The returned LibraryLocations may not exist if the
installLocation is not a valid install location.installLocation - home locationinstallLocation.LibraryLocation,
IVMInstallType.validateInstallLocation(File)protected LibraryInfo getDefaultLibraryInfo(java.io.File installLocation)
installLocation - the VM install locationpublic static java.util.List<LibraryLocation> gatherAllLibraries(java.lang.String[] dirPaths)
dirPaths - a list of absolute paths of directories to searchprotected java.io.File getDefaultExtensionDirectory(java.io.File installLocation)
null
if an extension directory is not supported.installLocation - the VM install locationnullprotected java.io.File getDefaultEndorsedDirectory(java.io.File installLocation)
null if an endorsed directory is not supported.installLocation - the VM install locationnullprotected java.lang.String getDefaultRootPath()
protected void setDefaultRootPath(java.lang.String defaultRootPath)
public IStatus validateInstallLocation(java.io.File javaHome)
IVMInstallTypeFor example, an implementation might check whether the VM executable is present.
javaHome - the root directory of a potential installation for
this type of VMprotected LibraryInfo generateLibraryInfo(java.io.File javaHome, java.io.File javaExecutable)
org.eclipse.jdt.internal.launching.support.
LibraryDetector), that dumps the system properties for bootpath
and extension directories. This output is then parsed and cached for
future reference.javaHome - the Java home folderjavaExecutable - the Java executable filenull if noneprotected LibraryInfo parseLibraryInfo(IProcess process)
process - the backing IProcess that was runLibraryInfo object or nullprotected java.lang.String[] parsePaths(java.lang.String paths)
public void disposeVMInstall(java.lang.String id)
IVMInstallTypedisposeVMInstall in interface IVMInstallTypedisposeVMInstall in class AbstractVMInstallTypeid - the id of the VM to be disposed.public java.net.URL getDefaultJavadocLocation(java.io.File installLocation)
AbstractVMInstallTypenull if none. The default
implementation returns null, subclasses must override as
appropriate.
Note, this method would ideally be added to IVMInstallType,
but it would have been a breaking API change between 2.0 and 2.1. Thus,
it has been added to the abstract base class that VM install types should
subclass.
getDefaultJavadocLocation in class AbstractVMInstallTypeinstallLocation - home locationnullpublic static java.net.URL getDefaultJavadocLocation(java.lang.String version)
null.version - language version such as "1.4"nullpublic java.lang.String readReleaseVersion(java.io.File javaHome)