The java
command supports a wide range of options:
\\-
): the GNU/Linux convention of using --
for “long” options is not supported.<classname>
or the -jar <jarfile>
argument to be recognized. Any arguments after them will be treated as arguments to be passed to Java app that is being run.-X
or -XX
are standard options. You can rely on all Java implementations1 to support any standard option.-X
are non-standard options, and may be withdrawn from one Java version to the next.-XX
are advanced options, and may also be withdrawn.-D
The -D<property>=<value>
option is used to set a property in the system Properties
object. This parameter can be repeated to set different properties.
The main options for controlling the heap and stack sizes are documented in http://stackoverflow.com/documentation/java/2804/java-memory-management/18190/setting-the-heap-permgen-and-stack-sizes. (Editorial note: Garbage Collector options should be described in the same topic.)
The -ea
and -da
options respectively enable and disable Java assert
checking:
-ea
option enables checking of all assertions-ea:<packagename>...
enables checking of assertions in a package and all subpackages.-ea:<classname>...
enables checking of assertions in a class.-da
option disables checking of all assertions-da:<packagename>...
disables checking of assertions in a package and all subpackages.-da:<classname>...
disables checking of assertions in a class.-esa
option enables checking for all system classes.