java.lang.Objectcom.install4j.api.JVMSelector
public class JVMSelector
With this class, you can retrieve the installed JVMs on Windows, Linux and Unix systems. Additionally, you can set the preferred VM for your application.
| Nested Class Summary | |
|---|---|
static interface |
JVMSelector.JVMLocation
The interface providing information about a JVM. |
| Method Summary | |
|---|---|
static JVMSelector.JVMLocation |
getJVMLocation(java.io.File javaHome,
java.lang.String minVersion,
java.lang.String maxVersion,
boolean jdkOnly)
Checks if this directory contains a JVM with the specificed parameters and returns the location object. |
static JVMSelector.JVMLocation[] |
getJVMLocations()
Returns JVMs found in standard locations. |
static JVMSelector.JVMLocation[] |
getJVMLocations(java.lang.String minVersion,
java.lang.String maxVersion,
boolean jdkOnly,
java.io.File[] additionalLocations)
Returns JVMs found in standard locations with the given version requirements. |
static void |
setPreferredJVM(java.lang.String javaHome)
Set the preferred JRE/JDK for your application. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static JVMSelector.JVMLocation[] getJVMLocations()
public static JVMSelector.JVMLocation[] getJVMLocations(java.lang.String minVersion,
java.lang.String maxVersion,
boolean jdkOnly,
java.io.File[] additionalLocations)
minVersion - the minimum java versionmaxVersion - the maximum java versionjdkOnly - only JDKsadditionalLocations - additional locations that should be tested for JVMs
public static JVMSelector.JVMLocation getJVMLocation(java.io.File javaHome,
java.lang.String minVersion,
java.lang.String maxVersion,
boolean jdkOnly)
javaHome - the directory to checkminVersion - the minimum java versionmaxVersion - the maximum java versionjdkOnly - only JDKs
public static void setPreferredJVM(java.lang.String javaHome)
javaHome - the base directory of the JDK/JRE.