org.eclipse.wst.jsdt.launching

## Class StandardVMType

- java.lang.Object
- - org.eclipse.wst.jsdt.launching.AbstractVMInstallType
  - - org.eclipse.wst.jsdt.launching.StandardVMType

All Implemented Interfaces:
  IVMInstallType

    public class StandardVMType
    extends AbstractVMInstallType

A VM install type for VMs the conform to the standard JDK installion layout. Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

### Field Summary

Fields
`static java.lang.String` `ID_STANDARD_VM_TYPE`

### Constructor Summary

Constructors
Constructor and Description
`StandardVMType()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`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.
`protected java.util.List` `gatherAllLibraries(java.lang.String[] dirPaths)` Returns a list of all zips and jars contained in the given directories.
`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 jsdoc location of a VM installed at the given home location, or `null` if none.
`LibraryLocation[]` `getDefaultLibraryLocations(java.io.File installLocation)` NOTE: We do not add libraries from the "endorsed" directory explicitly, as the bootpath contains these entries already (if they exist).
`protected IPath` `getDefaultPackageRootPath()`
`protected java.lang.String` `getDefaultRootPath()`
`protected IPath` `getDefaultSystemLibrary(java.io.File javaHome)` Return an `IPath` corresponding to the single library file containing the standard JavaScript 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 libaray, or an empty path if none.
`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 java.lang.String[]` `parsePaths(java.lang.String paths)`
`protected void` `setDefaultRootPath(java.lang.String defaultRootPath)`
`IStatus` `validateInstallLocation(java.io.File javaHome)` Validates the given location of a VM installation.

### Methods inherited from class org.eclipse.wst.jsdt.launching.AbstractVMInstallType

`createVMInstall, findVMInstall, findVMInstallByName, getId, getVMInstalls, setInitializationData`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### ID_STANDARD_VM_TYPE

    public static final java.lang.String ID_STANDARD_VM_TYPE

See Also:
  Constant Field Values

### Constructor Detail

#### StandardVMType

    public StandardVMType()

### Method Detail

#### findJavaExecutable

    public static java.io.File findJavaExecutable(java.io.File vmInstallLocation)

Starting in the specified VM install location, attempt to find the 'java' executable file. If found, return the corresponding `File` object, otherwise return `null`.

#### getName

    public java.lang.String getName()

Description copied from interface: `IVMInstallType`
Returns the display name of this VM type.

Returns:
  the name of this IVMInstallType

#### doCreateVMInstall

    protected IVMInstall doCreateVMInstall(java.lang.String id)

Description copied from class: `AbstractVMInstallType`
Subclasses should return a new instance of the appropriate `IVMInstall` subclass from this method.

Specified by:
  `doCreateVMInstall` in class `AbstractVMInstallType`
Parameters:
  `id` - The vm's id. The `IVMInstall` instance that is created must return `id` from its `getId()` method. Must not be `null`.
Returns:
  the newly created IVMInstall instance. Must not return `null`.

#### getVMVersion

    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.

Parameters:
  `javaHome` -
  `javaExecutable` -
Returns:
  String

#### detectInstallLocation

    public java.io.File detectInstallLocation()

Description copied from interface: `IVMInstallType`
Tries to detect an installed VM that matches this VM install type. Typically, this method will detect the VM installation the Eclipse platform runs on. Implementers should return `null` if they can't assure that a given vm install matches this IVMInstallType.

Returns:
  The location of an VM installation that can be used with this VM install type, or `null` if unable to locate an installed VM.

#### getDefaultSystemLibrary

    protected IPath getDefaultSystemLibrary(java.io.File javaHome)

Return an `IPath` corresponding to the single library file containing the standard JavaScript classes for most VMs version 1.2 and above.

#### getDefaultSystemLibrarySource

    protected IPath getDefaultSystemLibrarySource(java.io.File libLocation)

Returns a path to the source attachment for the given libaray, or an empty path if none.

Parameters:
  `libLocation` -
Returns:
  a path to the source attachment for the given library, or an empty path if none

#### getDefaultPackageRootPath

    protected IPath getDefaultPackageRootPath()

#### getDefaultLibraryLocations

    public LibraryLocation[] getDefaultLibraryLocations(java.io.File installLocation)

NOTE: We do not add libraries from the "endorsed" directory explicitly, as the bootpath contains these entries already (if they exist).

Parameters:
  `installLocation` - home location
Returns:
  default library locations based on the given `installLocation`.
See Also:
  `org.eclipse.jdt.launching.IVMInstallType#getDefaultLibraryLocations(File)`

#### gatherAllLibraries

    protected java.util.List gatherAllLibraries(java.lang.String[] dirPaths)

Returns a list of all zips and jars contained in the given directories.

Parameters:
  `dirPaths` - a list of absolute paths of directories to search
Returns:
  List of all zips and jars

#### getDefaultExtensionDirectory

    protected java.io.File getDefaultExtensionDirectory(java.io.File installLocation)

Returns the default location of the extension directory, based on the given install location. The resulting file may not exist, or be `null` if an extension directory is not supported.

Parameters:
  `installLocation` -
Returns:
  default extension directory or `null`

#### getDefaultEndorsedDirectory

    protected java.io.File getDefaultEndorsedDirectory(java.io.File installLocation)

Returns the default location of the endorsed directory, based on the given install location. The resulting file may not exist, or be `null` if an endorsed directory is not supported.

Parameters:
  `installLocation` -
Returns:
  default endorsed directory or `null`

#### getDefaultRootPath

    protected java.lang.String getDefaultRootPath()

#### setDefaultRootPath

    protected void setDefaultRootPath(java.lang.String defaultRootPath)

#### validateInstallLocation

    public IStatus validateInstallLocation(java.io.File javaHome)

Description copied from interface: `IVMInstallType`
Validates the given location of a VM installation.

For example, an implementation might check whether the VM executable is present.

Parameters:
  `javaHome` - the root directory of a potential installation for this type of VM
Returns:
  a status object describing whether the install location is valid

#### parsePaths

    protected java.lang.String[] parsePaths(java.lang.String paths)

#### disposeVMInstall

    public void disposeVMInstall(java.lang.String id)

Description copied from interface: `IVMInstallType`
Remove the VM associated with the given id from the set of VMs managed by this VM type. Has no effect if a VM with the given id is not currently managed by this type. A VM install that is disposed may not be used anymore.

Specified by:
  `disposeVMInstall` in interface `IVMInstallType`
Overrides:
  `disposeVMInstall` in class `AbstractVMInstallType`
Parameters:
  `id` - the id of the VM to be disposed.

#### getDefaultJavadocLocation

    public java.net.URL getDefaultJavadocLocation(java.io.File installLocation)

Description copied from class: `AbstractVMInstallType`
Returns a URL for the default jsdoc location of a VM installed at the given home location, or `null` 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.

Overrides:
  `getDefaultJavadocLocation` in class `AbstractVMInstallType`
Parameters:
  `installLocation` - home location
Returns:
  default jsdoc location or `null`