Specifying command-line options
Although the command line is the traditional way to specify command-line options, you can also pass options to the Java™ virtual machine (VM) by using a manifest file, options files, and environment variables.
java -Xint -Xjit myClassUse single or double quotation marks for command-line
options only when explicitly directed to do so. Single and double
quotation marks have different meanings on different platforms, operating
systems, and shells. Do not use '-X<option>' or "-X<option>".
Instead, you must use -X<option>. For example,
do not use '-Xmx500m' and "-Xmx500m".
Write this option as -Xmx500m.
- Certain options are created automatically by the VM, which specify arguments such as search
paths and version information. The VM automatically adds
-Xoptionsfile=<vm_dir>/options.default
at the beginning of the command line, where <vm_dir>
is the virtual machine directory. This directory is as follows:
- install_dir/lib/<arch>/default
You can modify the options.default file to include any options that you want to specify for your application instead of entering these options on the command line. For more information about the construction of the file, see -Xoptionsfile.

Options can be specified in an executable JAR file by using the META-INF/MANIFEST.MF file. Options are placed in the main section in a header named
Example manifest file:IBM-Java-Options. Only oneIBM-Java-Optionsheader is permitted, but the header can contain multiple options, separated by spaces. A long sequence of options can be split using a header continuation but are treated as a single line.
This example manifest file is parsed as the following string:Manifest-Version: 1.0 Class-Path: . Main-Class: HelloWorld IBM-Java-Options: -Xshareclasses:name=mycache,nonfa tal,cacheDirPerm=1000 -Dproperty=example -Da.long.system.pro perty="this is a long system property value to demonstrate long JVM arguments in the manifest file"
Options specified in the manifest file are subject to the same restrictions as options files. For more information, see the -Xoptionsfile topic in the user guide.-Xshareclasses:name=mycache,nonfatal,cacheDirPerm=1000 -Dproperty=example -Da.long.system.property=this is a long system property value to demonstrate long JVM arguments in the manifest file
- Environment variables that are described in J9 environment variables are translated into
command-line options. For example, the following environment variable adds the parameter
-Xrs to the list of arguments:
export IBM_NOSIGHANDLER=<non_null_string>
- The IBM_JAVA_OPTIONS environment variable. You can set command-line options
using this environment variable. The options that you specify with this environment variable are
added to the command line when a JVM starts in that environment. The environment variable can contain multiple blank-delimited argument strings, but must not contain comments. For example:
export IBM_JAVA_OPTIONS="-Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump"
Note: The environment variable JAVA_TOOLS_OPTIONS is equivalent to IBM_JAVA_OPTIONS and is available for compatibility with JVMTI. - Options that are specified on the command line. For example:
java -Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump MyJavaClassThe Java launcher adds some automatically generated arguments to this list, such as the names of the main class.
-Xdump:java:events=vmstartHere is an extract from a Java core file that shows the options that are used:....
2CIUSERARG -Xdump:java:file=/home/test_javacore.txt,events=vmstop
2CIUSERARG -Dtest.cmdlineOption=1
2CIUSERARG -XXallowvmshutdown:true
2CIUSERARG -Xoptionsfile=test1.test_options_file
....