JVM Spec Files
InstallAnywhere 2024 R2
A JVM spec file, or JVM search instructions file, is a flat file with an extension of .jvm. Each operating system has its own set of search files that cater to different versions of the JVM, as well as belong to different vendors such as IBM, Sun Microsystems, and HP-UX. Examples of JVM spec file names are:
ibm_win32_14.jvm
ibm_aix_14X.jvm
sun_linux_jre15.jvm
JVM spec files contain a set of JVM search hints in the form of key-value pairs. The following is an example of a JVM spec file:
DESC: Sun Microsystems Java Runtime Environment (JRE) 1.5 for Linux
JVM_EXE:bin/java
PLATFORM_HINT:
JDK_HOME
JAVAHOME
JAVA_HOME
/:
JVM_PROPERTIES:
java.vendor=Sun...
java.version=1.5...
/:
PATH_HINT:
/usr/jre1.5.0
/usr/local/jre1.5.0
/usr/java/jre1.5.0
/:
A slash followed immediately by a colon ( /:) is used to separate keys that can have multiple values.
During the launch of the installer, the installer’s launcher reads the JVM spec file and uses the hints in this file to determine the location where the JRE is available on the target system.
Customizing and Creating JVM Spec Files
InstallAnywhere provides JVM spec files that target all the supported platforms. You can customize these files as well as add new files to the existing set.
You can instruct the installer to use more than one JVM spec file at the same time. (Use the JVM Search Settings box by selecting more than one file in the JVM Search Settings list (Build page > Build Installers view > Build Configurations tab > Build Targets subtab). The order in which the JVM spec files are listed in the JVM Search Settings list is important. The installation attempts to find a matching JRE using the first JVM spec file specified in the list, then work its way down the list.
Guidelines for Writing a JVM Spec File
If you write your own JVM spec file, note the following guidelines:
Guideline |
Description |
||||||||||||
Use a UNIX-compliant format |
JVM spec files should be written on a UNIX-compliant format (without Ctrl-M characters). |
||||||||||||
Maintain the proper format for the JVM_EXE key |
InstallAnywhere restricts the JVM_EXE key in the JVM spec file to have a value of:
You should maintain the same format when customizing the spec file. |
||||||||||||
PATH_HINT should contain the JRE path only until the JRE folder |
The PATH_HINT in the JVM spec file should contain the JRE path only until the JRE folder. For example, if the JRE is present at the following location:
the PATH_HINT should be:
Note:For Windows, you should not mention the drive letter (such as C: or D:) in the PATH_HINT section. |
||||||||||||
Wildcard (*) character can be used in the PATH_HINT section |
The wildcard (*) character can be used in the PATH_HINT section. |
||||||||||||
Regular expressions limited to ending ellipsis or wildcard character |
Regular expressions in the JVM_PROPERTIES section are limited to ending ellipsis (…) or wildcard (*) character. |
||||||||||||
Locations where JVM spec files can be stored |
By default, all JVM spec files are installed in the IA_HOME\resource\jvms directory. However, these files can be present at any location on the machine where InstallAnywhere is installed. In cases where a JVM spec file is located in a directory other than IA_HOME\resource\jvms, you need to identify the location of those JVM spec files by doing one of the following:
Instead of adding each platform-specific directory to this environment variable, such as: IA_JVM_SPECS_PATH=C:\IDEs\IA2011RC1\resource\jvms\aix; C:\IDEs\IA2011RC1\resource\jvms\generic-unix; C:\IDEs\IA2011RC1\resource\jvms\hpux; C:\IDEs\IA2011RC1\resource\jvms\linux…. you should point this environment variable to the directory which contains all of the platform-specific directories, such as: IA_JVM_SPECS_PATH=C:\IDEs\IA2011RC1\resource\jvms Note:The organization of the JVM spec files must be similar to that of $IA_HOME$/resource/jvms directory; each spec file must be placed in its own platform folder, such as:
|
||||||||||||
Restart is required if Spec file is added or modified |
If a new JVM spec file is added or an existing spec file is modified, the InstallAnywhere interface needs to be restarted for the changes to take effect. |
See Also