Specifying command-line options

Although the command line is the traditional way to specify command-line options, you can pass options to the JVM in other ways.

Use only single or double quotation marks for command-line options when explicitly directed to do so for the option in question. 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.

These precedence rules (in descending order) apply to specifying options:
  1. Command line.

    For example, java -X<option> MyClass

  2. A file containing a list of options, specified using the –Xoptionsfile option on the command line. For example, java -Xoptionsfile=myoptionfile.txt MyClass
    In the options file, specify each option on a new line; you can use the '\' character as a continuation character if you want a single option to span multiple lines. Use the '#' character to define comment lines. You cannot specify -classpath in an options file. Here is an example of an options file:
    #My options file
    -X<option1>
    -X<option2>=\
    <value1>,\
    <value2>
    -D<sysprop1>=<value1>
  3. 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.

    For example, set IBM_JAVA_OPTIONS=-X<option1> -X<option2>=<value1>



© Copyright IBM Corporation 2005, 2010. All Rights Reserved.
© Copyright Sun Microsystems, Inc. 1997, 2007, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
This information center is powered by Eclipse technology. (http://www.eclipse.org/)