Specifying Java options and system properties

You can specify Java™ options and system properties directly on the command line. You can also use an options file or an environment variable.

About this task

The sequence of the Java options on the command line defines which options take precedence during startup. Rightmost options have precedence over leftmost options. In the following example, the -Xjit option takes precedence:
java -Xint -Xjit myClass
For more information about how the Eclipse OpenJ9 VM constructs the runtime environment at startup, see Specifying command line options.

Use one of more of the options that are shown in the procedure to customize your runtime environment.

Procedure

  1. Specify options or system properties on the command line, as shown in the following example:
    java -Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump MyJavaClass
  2. Create an environment variable that is called IBM_JAVA_OPTIONS containing the options, as shown in the following example:
    export IBM_JAVA_OPTIONS="-Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump"
    On Windows, use set instead of export.
  3. Create a file that contains the options, and specify that file on the command line or in the IBM_JAVA_OPTIONS environment variable by using the -Xoptionsfile parameter. For more information about constructing this file, see -Xoptionsfile.