install4j API documentation


com.install4j.api
Class JVMSelector

java.lang.Object
  extended by com.install4j.api.JVMSelector

public class JVMSelector
extends java.lang.Object

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[] getJVMLocations()
          Returns JVMs found in standard locations.
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

getJVMLocations

public static JVMSelector.JVMLocation[] getJVMLocations()
Returns JVMs found in standard locations. On Windows the registry is used to get the JVMs. On Linux/Unix this methods searches the usual locations for JVMs. On Mac OS X, this method returns an empty array. Please be aware that this method can take some time on Linux/Unix as it executes java to gather version information.

Returns:
an array of JVMLocation objects. See this class for more detail.

setPreferredJVM

public static void setPreferredJVM(java.lang.String javaHome)
Set the preferred JRE/JDK for your application. As long as this JRE/JDK exists and fulfills the version requirement of your application it will be used.

Parameters:
javaHome - the base directory of the JDK/JRE.