About JVM Selection
InstallAnywhere 2024 R2
The Java virtual machine that is selected to run an InstallAnywhere-generated installer, or any Java application that was installed by an InstallAnywhere-generated installer, depends on the settings in your InstallAnywhere project and the Java executable files that are available on the end user's system.
The core of the JVM selection process is performed by InstallAnywhere's LaunchAnywhere technology. LaunchAnywhere launchers are capable of performing their own JVM search each time that they run. However, it is also possible to use any of the following methods for JVM selection:
• | Bundle a JVM with the installer to be used by the installer and, optionally, to be used by the launchers that your installer deploys. See Adding a VM Pack to Your Project and Customizing Individual Launcher Settings. |
• | Employ the results of the installer's JVM search. The installer's JVM search is a customizable scan of end users’ systems. The results of this search can then be used to configure the launchers that the installer deploys. |
• | Include in the Pre-Install sequence of your project a Choose Java VM panel. This panel lets end users specify whether they want to use the bundled JVM, use the local JVM that matches the installer’s JVM search criteria, start a JVM search in a non-standard directory, or browse for a local Java executable file. |
Basic JVM Selection by LaunchAnywhere Launchers
Without any significant changes to an InstallAnywhere project’s default settings, Java virtual machine selection is managed exclusively by InstallAnywhere's LaunchAnywhere technology in a fairly straightforward manner. This is true for both the installer's launcher and the launchers for your Java applications, provided that both of the following are true:
• | No Java VM is bundled with the installer. |
• | No Choose Java VM panel is included in the installer. |
A launcher first attempts to use the JVM that is specified in its current VM property (lax.nl.current.vm). If the JVM that is specified by that property is either unavailable or invalid, the launcher searches the system for a valid JVM.
When a LaunchAnywhere launcher must search for a JVM, it scans common system locations for Java executable files and uses the first one that it finds that matches the criteria in its valid JVM list (lax.nl.valid.vm.list).
Note:The default JVM selection criteria that installers use is version 1.5 or later. For information on changing the valid JVM list for the installer's launcher, see Controlling the JVM That Your Installers Use. For information on changing the valid JVM list for a launcher that your installer deploys, see Customizing Individual Launcher Settings.
Impact of Bundled JVMs, Installer’s JVM Search, and the Choose Java VM Panel
Understanding which JVM a launcher will use becomes more complicated when you choose to do one or more of the following:
• | Bundled JVM—Include a bundled JVM with your installer. See Controlling the JVM That Your Installers Use. |
• | Custom JVM search—Customize the installer’s JVM search. See Customizing the VM Search Settings for Your Launchers and Customizing the VM Search Paths and Patterns. |
• | Choose Java VM panel—Include a Choose Java VM panel in your installer. See About the Choose Java VM Panel. |
For the launchers that the installer deploys, the JVM selection process can be much more complex. The JVM selected depends on:
• | The presence of a bundled JVM |
• | The results of the installer’s JVM search |
• | The presence of a Choose Java VM panel and that panel’s configuration |
• | The launcher's Advanced Settings |
• | The JVMs that are present on the end user’s system |
For detailed discussions of these conditions, see Controlling the JVM that Your Launchers Use and Using the Choose Java VM Panel.
Behavior that Triggers a JVM Search
The installer's launcher, the installer itself, and the installed LaunchAnywhere launchers are all capable of making JVM selection decisions and performing JVM searches—some during the install process and some after. The following behavior triggers when a JVM search is performed.
• | The installer’s launcher determines which JVM to use to run the installer—When an end user runs an InstallAnywhere installer, the installer’s launcher searches the target system for a JVM bootstrap that meets the criteria that are expressed in your project’s installer valid VM list (which is set in the Advanced Designer: Project page > JVM Settings view > Installer Settings tab > Valid VM list). For more information, see Controlling the JVM That Your Installers Use. |
• | The installer can determine which JVM the LaunchAnywhere launchers use—Once the installer is running, it performs a search for a JVM to use with any LaunchAnywhere launchers it will install. The criteria the installer uses for this search depends on JVM search settings you provide on the Search Panel Settings tab of the Project > JVM Settings task. For details, see Controlling the JVM that Your Launchers Use. |
These settings can be further customized for Windows-based and UNIX-based installers. See Customizing the VM Search Paths and Patterns.
• | The LaunchAnyhwere launchers can determine which JVM to use—LaunchAnywhere launchers are also capable of performing an independent JVM search when they are executed. LaunchAnywhere performs this search when it does not receive a JVM setting from the installer or when specifically set to perform its own search. For information on how to require LaunchAnywhere to perform its own JVM search, see Customizing Individual Launcher Settings. |
Locations on a Target System that Are Searched for JVMs
The common locations that are examined during a JVM search that is performed by an InstallAnywhere launcher or an installer are similar.
Platform |
Search Location |
Windows |
The directories that are listed in the PATH environment variable as well as the following registry keys are searched for JVMs: SOFTWARE\JavaSoft\Java Development Kit SOFTWARE\JavaSoft\Java Runtime Environment SOFTWARE\IBM\Java2 Runtime Environment SOFTWARE\IBM\Java Development Kit |
UNIX |
Launchers search only the PATH environment variable. The installer JVM search includes the PATH environment variable as well as the following paths: /bin /usr/bin /usr/local/bin /opt /opt/gnu/bin /usr/gnu/bin |
See Also
How the Installer’s Launcher Selects a JVM