JVM Spec Files

InstallAnywhere 2017

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:




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
















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:

Guidelines for Writing a JVM Spec File



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:

Windows: bin\java.exe
UNIX: bin/java

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:

Windows: C:\Program Files\jre1.5.07
UNIX: /usr/java5_64/jre

the PATH_HINT should be:

Windows: \Program Files\jre1.5.07
UNIX: /usr/java5_64/jre

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:

InstallAnywhere Preferences dialog box—You can specify the location of the JVM spec files in the JVM Specs Resource Paths field on the Resources tab of the InstallAnywhere Preferences dialog box. In this field, enter a semicolon-separated path list where JVM spec files are located. InstallAnywhere scans the paths listed here and populates the Choose JVM Spec dialog box with the JVM spec files it finds on these paths as well as those stored at the default JVM spec file location (IA_HOME\resource\jvms).
Environment variable—You can specify the location of the JVM spec files by setting the IA_JVM_SPECS_PATHS environment variable to a semicolon-separated list of paths.

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:


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