products/Sources/formale Sprachen/JAVA/openjdk-20-36_src/src/java.base/share/man image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: tip31.html   Sprache: HTML

Untersuchungsergebnis.1 Download desIsabelle {Isabelle[293] Haskell[375] BAT[467]}zum Wurzelverzeichnis wechseln

.\" Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation.
.\"
.\" This code is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code).
.\"
.\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
'\" t
.\" Automatically generated by Pandoc 2.19.2
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.
.ie "\f[CB]x\f[R]"x" \{\
. ftr V B
. ftr VI BI
. ftr VB B
. ftr VBI BI
.\}
.el \{\
. ftr V CR
. ftr VI CI
. ftr VB CB
. ftr VBI CBI
.\}
.TH "JAVA" "1" "2023" "JDK 20" "JDK Commands"
.hy
.SH NAME
.PP
java - launch a Java application
.SH SYNOPSIS
.PP
To launch a class file:
.PP
\f[V]java\f[R] [\f[I]options\f[R]] \f[I]mainclass\f[R] [\f[I]args\f[R]
\&...]
.PP
To launch the main class in a JAR file:
.PP
\f[V]java\f[R] [\f[I]options\f[R]] \f[V]-jar\f[R] \f[I]jarfile\f[R]
[\f[I]args\f[R] ...]
.PP
To launch the main class in a module:
.PP
\f[V]java\f[R] [\f[I]options\f[R]] \f[V]-m\f[R]
\f[I]module\f[R][\f[V]/\f[R]\f[I]mainclass\f[R]] [\f[I]args\f[R] ...]
.PP
or
.PP
\f[V]java\f[R] [\f[I]options\f[R]] \f[V]--module\f[R]
\f[I]module\f[R][\f[V]/\f[R]\f[I]mainclass\f[R]] [\f[I]args\f[R] ...]
.PP
To launch a single source-file program:
.PP
\f[V]java\f[R] [\f[I]options\f[R]] \f[I]source-file\f[R] [\f[I]args\f[R]
\&...]
.TP
\f[I]options\f[R]
Optional: Specifies command-line options separated by spaces.
See \f[B]Overview of Java Options\f[R] for a description of available
options.
.TP
\f[I]mainclass\f[R]
Specifies the name of the class to be launched.
Command-line entries following \f[V]classname\f[R] are the arguments for
the main method.
.TP
\f[V]-jar\f[R] \f[I]jarfile\f[R]
Executes a program encapsulated in a JAR file.
The \f[I]jarfile\f[R] argument is the name of a JAR file with a manifest
that contains a line in the form
\f[V]Main-Class:\f[R]\f[I]classname\f[R] that defines the class with the
\f[V]public static void main(String[] args)\f[R] method that serves as
your application\[aq]s starting point.
When you use \f[V]-jar\f[R], the specified JAR file is the source of all
user classesand other class path settings are ignored.
If you\[aq]re using JAR files, then see \f[B]jar\f[R].
.TP
\f[V]-m\f[R] or \f[V]--module\f[R] \f[I]module\f[R][\f[V]/\f[R]\f[I]mainclass\f[R]]
Executes the main class in a module specified by \f[I]mainclass\f[R] if
it is given, or, if it is not given, the value in the \f[I]module\f[R].
In other words, \f[I]mainclass\f[R] can be used when it is not specified
by the module, or to override the value when it is specified.
.RS
.PP
See \f[B]Standard Options for Java\f[R].
.RE
.TP
\f[I]source-file\f[R]
Only used to launch a single source-file program.
Specifies the source file that contains the main class when using
source-file mode.
See \f[B]Using Source-File Mode to Launch Single-File Source-Code
Programs\f[R]
.TP
\f[I]args\f[R] ...
Optional: Arguments following \f[I]mainclass\f[R],
\f[I]source-file\f[R], \f[V]-jar\f[R] \f[I]jarfile\f[R], and
\f[V]-m\f[R] or \f[V]--module\f[R]
\f[I]module\f[R]\f[V]/\f[R]\f[I]mainclass\f[R] are passed as arguments
to the main class.
.SH DESCRIPTION
.PP
The \f[V]java\f[R] command starts a Java application.
It does this by starting the Java Virtual Machine (JVM), loading the
specified classand calling that class\[aq]s \f[V]main()\f[R] method.
The method must be declared \f[V]public\f[R] and \f[V]static\f[R], it
must not return any valueand it must accept a \f[V]String\f[R] array
as a parameter.
The method declaration has the following form:
.RS
.PP
\f[V]public static void main(String[] args)\f[R]
.RE
.PP
In source-file mode, the \f[V]java\f[R] command can launch a class
declared in a source file.
See \f[B]Using Source-File Mode to Launch Single-File Source-Code
Programs\f[R] for a description of using the source-file mode.
.RS
.PP
\f[B]Note:\f[R] You can use the \f[V]JDK_JAVA_OPTIONS\f[R] launcher
environment variable to prepend its content to the actual command line
of the \f[V]java\f[R] launcher.
See \f[B]Using the JDK_JAVA_OPTIONS Launcher Environment Variable\f[R].
.RE
.PP
By default, the first argument that isn\[aq]t an option of the
\f[V]java\f[R] command is the fully qualified name of the class to be
called.
If \f[V]-jar\f[R] is specified, then its argument is the name of the JAR
file containing class and resource files for the application.
The startup class must be indicated by the \f[V]Main-Class\f[R] manifest
header in its manifest file.
.PP
Arguments after the class file name or the JAR file name are passed to
the \f[V]main()\f[R] method.
.SS \f[V]javaw\f[R]
.PP
\f[B]Windows:\f[R] The \f[V]javaw\f[R] command is identical to
\f[V]java\f[R], except that with \f[V]javaw\f[R] there\[aq]s no
associated console window.
Use \f[V]javaw\f[R] when you don\[aq]t want a command prompt window to
appear.
The \f[V]javaw\f[R] launcher will, however, display a dialog box with
error information if a launch fails.
.SH USING SOURCE-FILE MODE TO LAUNCH SINGLE-FILE SOURCE-CODE PROGRAMS
.PP
To launch a class declared in a source file, run the \f[V]java\f[R]
launcher in source-file mode.
Entering source-file mode is determined by two items on the
\f[V]java\f[R] command line:
.IP \[bu] 2
The first item on the command line that is not an option or part of an
option.
In other words, the item in the command line that would otherwise be the
main class name.
.IP \[bu] 2
The \f[V]--source\f[R] \f[I]version\f[R] option, if present.
.PP
If the class identifies an existing file that has a \f[V].java\f[R]
extension, or if the \f[V]--source\f[R] option is specified, then
source-file mode is selected.
The source file is then compiled and run.
The \f[V]--source\f[R] option can be used to specify the source
\f[I]version\f[R] or \f[I]N\f[R] of the source code.
This determines the API that can be used.
When you set \f[V]--source\f[R] \f[I]N\f[R], you can only use the public
API that was defined in JDK \f[I]N\f[R].
.RS
.PP
\f[B]Note:\f[R] The valid values of \f[I]N\f[R] change for each release,
with new values added and old values removed.
You\[aq]ll get an error message if you use a value of \f[I]N\f[R] that
is no longer supported.
The supported values of \f[I]N\f[R] are the current Java SE release
(\f[V]20\f[R]) and a limited number of previous releases, detailed in
the command-line help for \f[V]javac\f[R], under the \f[V]--source\f[R]
and \f[V]--release\f[R] options.
.RE
.PP
If the file does not have the \f[V].java\f[R] extension, the
\f[V]--source\f[R] option must be used to tell the \f[V]java\f[R]
command to use the source-file mode.
The \f[V]--source\f[R] option is used for cases when the source file is
\[dq]script\[dq] to be executed and the name of the source file does
not follow the normal naming conventions for Java source files.
.PP
In source-file mode, the effect is as though the source file is compiled
into memory, and the first class found in the source file is executed.
Any arguments placed after the name of the source file in the original
command line are passed to the compiled class when it is executed.
.PP
For example, if a file were named \f[V]HelloWorld.java\f[R] and
contained a class named \f[V]hello.World\f[R], then the source-file mode
command to launch the class would be:
.RS
.PP
\f[V]java HelloWorld.java\f[R]
.RE
.PP
The example illustrates that the class can be in a named package, and
does not need to be in the unnamed package.
This use of source-file mode is informally equivalent to using the
following two commands where \f[V]hello.World\f[R] is the name of the
class in the package:
.IP
.nf
\f[CB]
javac -d <memory> HelloWorld.java
java -cp <memory> hello.World
\f[R]
.fi
.PP
\f[B]In source-file mode, any additional command-line options are
processed as follows:\f[R]
.IP \[bu] 2
The launcher scans the options specified before the source file for any
that are relevant in order to compile the source file.
.RS 2
.PP
This includes\f[V]--class-path\f[R], \f[V]--module-path\f[R],
\f[V]--add-exports\f[R], \f[V]--add-modules\f[R],
\f[V]--limit-modules\f[R], \f[V]--patch-module\f[R],
\f[V]--upgrade-module-path\f[R], and any variant forms of those options.
It also includes the new \f[V]--enable-preview\f[R] option, described in
JEP 12.
.RE
.IP \[bu] 2
No provision is made to pass any additional options to the compiler,
such as \f[V]-processor\f[R] or \f[V]-Werror\f[R].
.IP \[bu] 2
Command-line argument files (\f[V]\[at]\f[R]-files) may be used in the
standard way.
Long lists of arguments for either the VM or the program being invoked
may be placed in files specified on the command-line by prefixing the
filename with an \f[V]\[at]\f[R] character.
.PP
\f[B]In source-file mode, compilation proceeds as follows:\f[R]
.IP \[bu] 2
Any command-line options that are relevant to the compilation
environment are taken into account.
.IP \[bu] 2
No other source files are found and compiled, as if the source path is
set to an empty value.
.IP \[bu] 2
Annotation processing is disabled, as if \f[V]-proc:none\f[R] is in
effect.
.IP \[bu] 2
If a version is specified, via the \f[V]--source\f[R] option, the value
is used as the argument for an implicit \f[V]--release\f[R] option for
the compilation.
This sets both the source version accepted by compiler and the system
API that may be used by the code in the source file.
.IP \[bu] 2
The source file is compiled in the context of an unnamed module.
.IP \[bu] 2
The source file should contain one or more top-level classes, the first
of which is taken as the class to be executed.
.IP \[bu] 2
The compiler does not enforce the optional restriction defined at the
end of JLS 7.6, that a type in a named package should exist in a file
whose name is composed from the type name followed by the
\f[V].java\f[R] extension.
.IP \[bu] 2
If the source file contains errors, appropriate error messages are
written to the standard error stream, and the launcher exits with a
non-zero exit code.
.PP
\f[B]In source-file mode, execution proceeds as follows:\f[R]
.IP \[bu] 2
The class to be executed is the first top-level class found in the
source file.
It must contain a declaration of the standard
\f[V]public static void main(String[])\f[R] method.
.IP \[bu] 2
The compiled classes are loaded by a custom class loader, that delegates
to the application class loader.
This implies that classes appearing on the application class path cannot
refer to any classes declared in the source file.
.IP \[bu] 2
The compiled classes are executed in the context of an unnamed module,
as though \f[V]--add-modules=ALL-DEFAULT\f[R] is in effect.
This is in addition to any other \f[V]--add-module\f[R] options that may
be have been specified on the command line.
.IP \[bu] 2
Any arguments appearing after the name of the file on the command line
are passed to the standard main method in the obvious way.
.IP \[bu] 2
It is an error if there is a class on the application class path whose
name is the same as that of the class to be executed.
.PP
See \f[B]JEP 330: Launch Single-File Source-Code Programs\f[R]
[https://openjdk.org/jeps/330] for complete details.
.SH USING THE JDK_JAVA_OPTIONS LAUNCHER ENVIRONMENT VARIABLE
.PP
\f[V]JDK_JAVA_OPTIONS\f[R] prepends its content to the options parsed
from the command line.
The content of the \f[V]JDK_JAVA_OPTIONS\f[R] environment variable is a
list of arguments separated by white-space characters (as determined by
\f[V]isspace()\f[R]).
These are prepended to the command line arguments passed to
\f[V]java\f[R] launcher.
The encoding requirement for the environment variable is the same as the
\f[V]java\f[R] command line on the system.
\f[V]JDK_JAVA_OPTIONS\f[R] environment variable content is treated in
the same manner as that specified in the command line.
.PP
Single (\f[V]\[aq]\f[R]) or double (\f[V]\[dq]\f[R]) quotes can be used
to enclose arguments that contain whitespace characters.
All content between the open quote and the first matching close quote
are preserved by simply removing the pair of quotes.
In case a matching quote is not found, the launcher will abort with an
error message.
\f[V]\[at]\f[R]-files are supported as they are specified in the command
line.
However, as in \f[V]\[at]\f[R]-files, use of a wildcard is not
supported.
In order to mitigate potential misuse of \f[V]JDK_JAVA_OPTIONS\f[R]
behavior, options that specify the main class (such as \f[V]-jar\f[R])
or cause the \f[V]java\f[R] launcher to exit without executing the main
class (such as \f[V]-h\f[R]) are disallowed in the environment variable.
If any of these options appear in the environment variable, the launcher
will abort with an error message.
When \f[V]JDK_JAVA_OPTIONS\f[R] is set, the launcher prints a message to
stderr as a reminder.
.PP
\f[B]Example:\f[R]
.IP
.nf
\f[CB]
$ export JDK_JAVA_OPTIONS=\[aq]-g \[at]file1 -Dprop=value \[at]file2 -Dws.prop=\[dq]white spaces\[dq]\[aq]
$ java -Xint \[at]file3
\f[R]
.fi
.PP
is equivalent to the command line:
.IP
.nf
\f[CB]
java -g \[at]file1 -Dprop=value \[at]file2 -Dws.prop=\[dq]white spaces\[dq] -Xint \[at]file3
\f[R]
.fi
.SH OVERVIEW OF JAVA OPTIONS
.PP
The \f[V]java\f[R] command supports a wide range of options in the
following categories:
.IP \[bu] 2
\f[B]Standard Options for Java\f[R]: Options guaranteed to be supported
by all implementations of the Java Virtual Machine (JVM).
They\[aq]re used for common actions, such as checking the version of the
JRE, setting the class path, enabling verbose outputand so on.
.IP \[bu] 2
\f[B]Extra Options for Java\f[R]: General purpose options that are
specific to the Java HotSpot Virtual Machine.
They aren\[aq]t guaranteed to be supported by all JVM implementations,
and are subject to change.
These options start with \f[V]-X\f[R].
.PP
The advanced options aren\[aq]t recommended for casual use.
These are developer options used for tuning specific areas of the Java
HotSpot Virtual Machine operation that often have specific system
requirements and may require privileged access to system configuration
parameters.
Several examples of performance tuning are provided in \f[B]Performance
Tuning Examples\f[R].
These options aren\[aq]t guaranteed to be supported by all JVM
implementations and are subject to change.
Advanced options start with \f[V]-XX\f[R].
.IP \[bu] 2
\f[B]Advanced Runtime Options for Java\f[R]: Control the runtime
behavior of the Java HotSpot VM.
.IP \[bu] 2
\f[B]Advanced JIT Compiler Options for java\f[R]: Control the dynamic
just-in-time (JIT) compilation performed by the Java HotSpot VM.
.IP \[bu] 2
\f[B]Advanced Serviceability Options for Java\f[R]: Enable gathering
system information and performing extensive debugging.
.IP \[bu] 2
\f[B]Advanced Garbage Collection Options for Java\f[R]: Control how
garbage collection (GC) is performed by the Java HotSpot
.PP
Boolean options are used to either enable a feature that\[aq]s disabled
by default or disable a feature that\[aq]s enabled by default.
Such options don\[aq]t require a parameter.
Boolean \f[V]-XX\f[R] options are enabled using the plus sign
(\f[V]-XX:+\f[R]\f[I]OptionName\f[R]) and disabled using the minus sign
(\f[V]-XX:-\f[R]\f[I]OptionName\f[R]).
.PP
For options that require an argument, the argument may be separated from
the option name by a space, a colon (:), or an equal sign (=), or the
argument may directly follow the option (the exact syntax differs for
each option).
If you\[aq]re expected to specify the size in bytes, then you can use no
suffix, or use the suffix \f[V]k\f[R] or \f[V]K\f[R] for kilobytes (KB),
\f[V]m\f[R] or \f[V]M\f[R] for megabytes (MB), or \f[V]g\f[R] or
\f[V]G\f[R] for gigabytes (GB).
For example, to set the size to 8 GB, you can specify either
\f[V]8g\f[R], \f[V]8192m\f[R], \f[V]8388608k\f[R], or
\f[V]8589934592\f[R] as the argument.
If you are expected to specify the percentage, then use a number from 0
to 1.
For example, specify \f[V]0.25\f[R] for 25%.
.PP
The following sections describe the options that are deprecated,
obsolete, and removed:
.IP \[bu] 2
\f[B]Deprecated Java Options\f[R]: Accepted and acted upon --- a warning
is issued when they\[aq]re used.
.IP \[bu] 2
\f[B]Obsolete Java Options\f[R]: Accepted but ignored --- a warning is
issued when they\[aq]re used.
.IP \[bu] 2
\f[B]Removed Java Options\f[R]: Removed --- using them results in an
error.
.SH STANDARD OPTIONS FOR JAVA
.PP
These are the most commonly used options supported by all
implementations of the JVM.
.RS
.PP
\f[B]Note:\f[R] To specify an argument for a long option, you can use
either \f[V]--\f[R]\f[I]name\f[R]\f[V]=\f[R]\f[I]value\f[R] or
\f[V]--\f[R]\f[I]name\f[R] \f[I]value\f[R].
.RE
.TP
\f[V]-agentlib:\f[R]\f[I]libname\f[R][\f[V]=\f[R]\f[I]options\f[R]]
Loads the specified native agent library.
After the library name, a comma-separated list of options specific to
the library can be used.
If the option \f[V]-agentlib:foo\f[R] is specified, then the JVM
attempts to load the library named \f[V]foo\f[R] using the platform
specific naming conventions and locations:
.RS
.IP \[bu] 2
\f[B]Linux and other POSIX-like platforms:\f[R] The JVM attempts to load
the library named \f[V]libfoo.so\f[R] in the location specified by the
\f[V]LD_LIBRARY_PATH\f[R] system variable.
.IP \[bu] 2
\f[B]macOS:\f[R] The JVM attempts to load the library named
\f[V]libfoo.dylib\f[R] in the location specified by the
\f[V]DYLD_LIBRARY_PATH\f[R] system variable.
.IP \[bu] 2
\f[B]Windows:\f[R] The JVM attempts to load the library named
\f[V]foo.dll\f[R] in the location specified by the \f[V]PATH\f[R] system
variable.
.RS 2
.PP
The following example shows how to load the Java Debug Wire Protocol
(JDWP) library and listen for the socket connection on port 8000,
suspending the JVM before the main class loads:
.RS
.PP
\f[V]-agentlib:jdwp=transport=dt_socket,server=y,address=8000\f[R]
.RE
.RE
.RE
.TP
\f[V]-agentpath:\f[R]\f[I]pathname\f[R][\f[V]=\f[R]\f[I]options\f[R]]
Loads the native agent library specified by the absolute path name.
This option is equivalent to \f[V]-agentlib\f[R] but uses the full path
and file name of the library.
.TP
\f[V]--class-path\f[R] \f[I]classpath\f[R], \f[V]-classpath\f[R] \f[I]classpath\f[R], or \f[V]-cp\f[R] \f[I]classpath\f[R]
Specifies a list of directories, JAR files, and ZIP archives to search
for class files.
.RS
.PP
On Windows, semicolons (\f[V];\f[R]) separate entities in this list; on
other platforms it is a colon (\f[V]:\f[R]).
.PP
Specifying \f[I]classpath\f[R] overrides any setting of the
\f[V]CLASSPATH\f[R] environment variable.
If the class path option isn\[aq]t used and \f[I]classpath\f[R]
isn\[aq]t set, then the user class path consists of the current
directory (.).
.PP
As a special convenience, a class path element that contains a base name
of an asterisk (*) is considered equivalent to specifying a list of all
the files in the directory with the extension \f[V].jar\f[R] or
\f[V].JAR\f[R] .
A Java program can\[aq]t tell the difference between the two
invocations.
For example, if the directory mydir contains \f[V]a.jar\f[R] and
\f[V]b.JAR\f[R], then the class path element mydir/* is expanded to
\f[V]A.jar:b.JAR\f[R], except that the order of JAR files is
unspecified.
All \f[V].jar\f[R] files in the specified directory, even hidden ones,
are included in the list.
class path entry consisting of an asterisk (*) expands to a list of
all the jar files in the current directory.
The \f[V]CLASSPATH\f[R] environment variable, where defined, is
similarly expanded.
Any class path wildcard expansion that occurs before the Java VM is
started.
Java programs never see wildcards that aren\[aq]t expanded except by
querying the environment, such as by calling
\f[V]System.getenv(\[dq]CLASSPATH\[dq])\f[R].
.RE
.TP
\f[V]--disable-\[at]files\f[R]
Can be used anywhere on the command line, including in an argument file,
to prevent further \f[V]\[at]filename\f[R] expansion.
This option stops expanding \f[V]\[at]\f[R]-argfiles after the option.
.TP
\f[V]--enable-preview\f[R]
Allows classes to depend on \f[B]preview features\f[R]
[https://docs.oracle.com/en/java/javase/12/language/index.html#JSLAN-GUID-5A82FE0E-0CA4-4F1F-B075-564874FE2823]
of the release.
.TP
\f[V]--finalization=\f[R]\f[I]value\f[R]
Controls whether the JVM performs finalization of objects.
Valid values are \[dq]enabled\[dq] and \[dq]disabled\[dq].
Finalization is enabled by default, so the value \[dq]enabled\[dq] does
nothing.
The value \[dq]disabled\[dq] disables finalization, so that no
finalizers are invoked.
.TP
\f[V]--module-path\f[R] \f[I]modulepath\f[R]... or \f[V]-p\f[R] \f[I]modulepath\f[R]
Specifies a list of directories in which each directory is a directory
of modules.
.RS
.PP
On Windows, semicolons (\f[V];\f[R]) separate directories in this list;
on other platforms it is a colon (\f[V]:\f[R]).
.RE
.TP
\f[V]--upgrade-module-path\f[R] \f[I]modulepath\f[R]...
Specifies a list of directories in which each directory is a directory
of modules that replace upgradeable modules in the runtime image.
.RS
.PP
On Windows, semicolons (\f[V];\f[R]) separate directories in this list;
on other platforms it is a colon (\f[V]:\f[R]).
.RE
.TP
\f[V]--add-modules\f[R] \f[I]module\f[R][\f[V],\f[R]\f[I]module\f[R]...]
Specifies the root modules to resolve in addition to the initial module.
\f[I]module\f[R] also can be \f[V]ALL-DEFAULT\f[R],
\f[V]ALL-SYSTEM\f[R], and \f[V]ALL-MODULE-PATH\f[R].
.TP
\f[V]--list-modules\f[R]
Lists the observable modules and then exits.
.TP
\f[V]-d\f[R] \f[I]module_name\f[R] or \f[V]--describe-module\f[R] \f[I]module_name\f[R]
Describes a specified module and then exits.
.TP
\f[V]--dry-run\f[R]
Creates the VM but doesn\[aq]t execute the main method.
This \f[V]--dry-run\f[R] option might be useful for validating the
command-line options such as the module system configuration.
.TP
\f[V]--validate-modules\f[R]
Validates all modules and exit.
This option is helpful for finding conflicts and other errors with
modules on the module path.
.TP
\f[V]-D\f[R]\f[I]property\f[R]\f[V]=\f[R]\f[I]value\f[R]
Sets a system property value.
The \f[I]property\f[R] variable is a string with no spaces that
represents the name of the property.
The \f[I]value\f[R] variable is a string that represents the value of
the property.
If \f[I]value\f[R] is a string with spaces, then enclose it in quotation
marks (for example \f[V]-Dfoo=\[dq]foo bar\[dq]\f[R]).
.TP
\f[V]-disableassertions\f[R][\f[V]:\f[R][\f[I]packagename\f[R]]...|\f[V]:\f[R]\f[I]classname\f[R]] or \f[V]-da\f[R][\f[V]:\f[R][\f[I]packagename\f[R]]...|\f[V]:\f[R]\f[I]classname\f[R]]
Disables assertions.
By default, assertions are disabled in all packages and classes.
With no arguments, \f[V]-disableassertions\f[R] (\f[V]-da\f[R]) disables
assertions in all packages and classes.
With the \f[I]packagename\f[R] argument ending in \f[V]...\f[R], the
switch disables assertions in the specified package and any subpackages.
If the argument is simply \f[V]...\f[R], then the switch disables
assertions in the unnamed package in the current working directory.
With the \f[I]classname\f[R] argument, the switch disables assertions in
the specified class.
.RS
.PP
The \f[V]-disableassertions\f[R] (\f[V]-da\f[R]) option applies to all
class loaders and to system classes (which don\[aq]t have a class
loader).
There\[aq]s one exception to this rule: If the option is provided with
no arguments, then it doesn\[aq]t apply to system classes.
This makes it easy to disable assertions in all classes except for
system classes.
The \f[V]-disablesystemassertions\f[R] option enables you to disable
assertions in all system classes.
To explicitly enable assertions in specific packages or classesuse the
\f[V]-enableassertions\f[R] (\f[V]-ea\f[R]) option.
Both options can be used at the same time.
For example, to run the \f[V]MyClass\f[R] application with assertions
enabled in the package \f[V]com.wombat.fruitbat\f[R] (and any
subpackages) but disabled in the class
\f[V]com.wombat.fruitbat.Brickbat\f[R], use the following command:
.RS
.PP
\f[V]java -ea:com.wombat.fruitbat... -da:com.wombat.fruitbat.Brickbat MyClass\f[R]
.RE
.RE
.TP
\f[V]-disablesystemassertions\f[R] or \f[V]-dsa\f[R]
Disables assertions in all system classes.
.TP
\f[V]-enableassertions\f[R][\f[V]:\f[R][\f[I]packagename\f[R]]...|\f[V]:\f[R]\f[I]classname\f[R]] or \f[V]-ea\f[R][\f[V]:\f[R][\f[I]packagename\f[R]]...|\f[V]:\f[R]\f[I]classname\f[R]]
Enables assertions.
By default, assertions are disabled in all packages and classes.
With no arguments, \f[V]-enableassertions\f[R] (\f[V]-ea\f[R]) enables
assertions in all packages and classes.
With the \f[I]packagename\f[R] argument ending in \f[V]...\f[R], the
switch enables assertions in the specified package and any subpackages.
If the argument is simply \f[V]...\f[R], then the switch enables
assertions in the unnamed package in the current working directory.
With the \f[I]classname\f[R] argument, the switch enables assertions in
the specified class.
.RS
.PP
The \f[V]-enableassertions\f[R] (\f[V]-ea\f[R]) option applies to all
class loaders and to system classes (which don\[aq]t have a class
loader).
There\[aq]s one exception to this rule: If the option is provided with
no arguments, then it doesn\[aq]t apply to system classes.
This makes it easy to enable assertions in all classes except for system
classes.
The \f[V]-enablesystemassertions\f[R] option provides a separate switch
to enable assertions in all system classes.
To explicitly disable assertions in specific packages or classesuse
the \f[V]-disableassertions\f[R] (\f[V]-da\f[R]) option.
If a single command contains multiple instances of these switches, then
they\[aq]re processed in order, before loading any classes.
For example, to run the \f[V]MyClass\f[R] application with assertions
enabled only in the package \f[V]com.wombat.fruitbat\f[R] (and any
subpackages) but disabled in the class
\f[V]com.wombat.fruitbat.Brickbat\f[R], use the following command:
.RS
.PP
\f[V]java -ea:com.wombat.fruitbat... -da:com.wombat.fruitbat.Brickbat MyClass\f[R]
.RE
.RE
.TP
\f[V]-enablesystemassertions\f[R] or \f[V]-esa\f[R]
Enables assertions in all system classes.
.TP
\f[V]-help\f[R], \f[V]-h\f[R], or \f[V]-?\f[R]
Prints the help message to the error stream.
.TP
\f[V]--help\f[R]
Prints the help message to the output stream.
.TP
\f[V]-javaagent:\f[R]\f[I]jarpath\f[R][\f[V]=\f[R]\f[I]options\f[R]]
Loads the specified Java programming language agent.
See \f[V]java.lang.instrument\f[R].
.TP
\f[V]--show-version\f[R]
Prints the product version to the output stream and continues.
.TP
\f[V]-showversion\f[R]
Prints the product version to the error stream and continues.
.TP
\f[V]--show-module-resolution\f[R]
Shows module resolution output during startup.
.TP
\f[V]-splash:\f[R]\f[I]imagepath\f[R]
Shows the splash screen with the image specified by \f[I]imagepath\f[R].
HiDPI scaled images are automatically supported and used if available.
The unscaled image file name, such as \f[V]image.ext\f[R], should always
be passed as the argument to the \f[V]-splash\f[R] option.
The most appropriate scaled image provided is picked up automatically.
.RS
.PP
For example, to show the \f[V]splash.gif\f[R] file from the
\f[V]images\f[R] directory when starting your application, use the
following option:
.RS
.PP
\f[V]-splash:images/splash.gif\f[R]
.RE
.PP
See the SplashScreen API documentation for more information.
.RE
.TP
\f[V]-verbose:class\f[R]
Displays information about each loaded class.
.TP
\f[V]-verbose:gc\f[R]
Displays information about each garbage collection (GC) event.
.TP
\f[V]-verbose:jni\f[R]
Displays information about the use of native methods and other Java
Native Interface (JNI) activity.
.TP
\f[V]-verbose:module\f[R]
Displays information about the modules in use.
.TP
\f[V]--version\f[R]
Prints product version to the output stream and exits.
.TP
\f[V]-version\f[R]
Prints product version to the error stream and exits.
.TP
\f[V]-X\f[R]
Prints the help on extra options to the error stream.
.TP
\f[V]--help-extra\f[R]
Prints the help on extra options to the output stream.
.TP
\f[V]\[at]\f[R]\f[I]argfile\f[R]
Specifies one or more argument files prefixed by \f[V]\[at]\f[R] used by
the \f[V]java\f[R] command.
It isn\[aq]t uncommon for the \f[V]java\f[R] command line to be very
long because of the \f[V].jar\f[R] files needed in the classpath.
The \f[V]\[at]\f[R]\f[I]argfile\f[R] option overcomes command-line
length limitations by enabling the launcher to expand the contents of
argument files after shell expansion, but before argument processing.
Contents in the argument files are expanded because otherwise, they
would be specified on the command line until the
\f[V]--disable-\[at]files\f[R] option was encountered.
.RS
.PP
The argument files can also contain the main class name and all options.
If an argument file contains all of the options required by the
\f[V]java\f[R] command, then the command line could simply be:
.RS
.PP
\f[V]java \[at]\f[R]\f[I]argfile\f[R]
.RE
.PP
See \f[B]java Command-Line Argument Files\f[R] for a description and
examples of using \f[V]\[at]\f[R]-argfiles.
.RE
.SH EXTRA OPTIONS FOR JAVA
.PP
The following \f[V]java\f[R] options are general purpose options that
are specific to the Java HotSpot Virtual Machine.
.TP
\f[V]-Xbatch\f[R]
Disables background compilation.
By default, the JVM compiles the method as a background task, running
the method in interpreter mode until the background compilation is
finished.
The \f[V]-Xbatch\f[R] flag disables background compilation so that
compilation of all methods proceeds as a foreground task until
completed.
This option is equivalent to \f[V]-XX:-BackgroundCompilation\f[R].
.TP
\f[V]-Xbootclasspath/a:\f[R]\f[I]directories\f[R]|\f[I]zip\f[R]|\f[I]JAR-files\f[R]
Specifies a list of directories, JAR files, and ZIP archives to append
to the end of the default bootstrap class path.
.RS
.PP
On Windows, semicolons (\f[V];\f[R]) separate entities in this list; on
other platforms it is a colon (\f[V]:\f[R]).
.RE
.TP
\f[V]-Xcheck:jni\f[R]
Performs additional checks for Java Native Interface (JNI) functions.
.RS
.PP
The following checks are considered indicative of significant problems
with the native code, and the JVM terminates with an irrecoverable error
in such cases:
.IP \[bu] 2
The thread doing the call is not attached to the JVM.
.IP \[bu] 2
The thread doing the call is using the \f[V]JNIEnv\f[R] belonging to
another thread.
.IP \[bu] 2
A parameter validation check fails:
.RS 2
.IP \[bu] 2
\f[V]jfieldID\f[R], or \f[V]jmethodID\f[R], is detected as being
invalid.
For example:
.RS 2
.IP \[bu] 2
Of the wrong type
.IP \[bu] 2
Associated with the wrong class
.RE
.IP \[bu] 2
A parameter of the wrong type is detected.
.IP \[bu] 2
An invalid parameter value is detected.
For example:
.RS 2
.IP \[bu] 2
NULL where not permitted
.IP \[bu] 2
An out-of-bounds array index, or frame capacity
.IP \[bu] 2
A non-UTF-8 string
.IP \[bu] 2
An invalid JNI reference
.IP \[bu] 2
An attempt to use a \f[V]ReleaseXXX\f[R] function on a parameter not
produced by the corresponding \f[V]GetXXX\f[R] function
.RE
.RE
.PP
The following checks only result in warnings being printed:
.IP \[bu] 2
A JNI call was made without checking for a pending exception from a
previous JNI call, and the current call is not safe when an exception
may be pending.
.IP \[bu] 2
class descriptor is in decorated format (\f[V]Lname;\f[R]) when it
should not be.
.IP \[bu] 2
\f[V]NULL\f[R] parameter is allowed, but its use is questionable.
.IP \[bu] 2
Calling other JNI functions in the scope of
\f[V]Get/ReleasePrimitiveArrayCritical\f[R] or
\f[V]Get/ReleaseStringCritical\f[R]
.PP
Expect a performance degradation when this option is used.
.RE
.TP
\f[V]-Xcomp\f[R]
Testing mode to exercise JIT compilers.
This option should not be used in production environments.
.TP
\f[V]-Xdebug\f[R]
Does nothing.
Provided for backward compatibility.
.TP
\f[V]-Xdiag\f[R]
Shows additional diagnostic messages.
.TP
\f[V]-Xint\f[R]
Runs the application in interpreted-only mode.
Compilation to native code is disabled, and all bytecode is executed by
the interpreter.
The performance benefits offered by the just-in-time (JIT) compiler
aren\[aq]t present in this mode.
.TP
\f[V]-Xinternalversion\f[R]
Displays more detailed JVM version information than the
\f[V]-version\f[R] option, and then exits.
.TP
\f[V]-Xlog:\f[R]\f[I]option\f[R]
Configure or enable logging with the Java Virtual Machine (JVM) unified
logging framework.
See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
.TP
\f[V]-Xmixed\f[R]
Executes all bytecode by the interpreter except for hot methods, which
are compiled to native code.
On by default.
Use \f[V]-Xint\f[R] to switch off.
.TP
\f[V]-Xmn\f[R] \f[I]size\f[R]
Sets the initial and maximum size (in bytes) of the heap for the young
generation (nursery) in the generational collectors.
Append the letter \f[V]k\f[R] or \f[V]K\f[R] to indicate kilobytes,
\f[V]m\f[R] or \f[V]M\f[R] to indicate megabytes, or \f[V]g\f[R] or
\f[V]G\f[R] to indicate gigabytes.
The young generation region of the heap is used for new objects.
GC is performed in this region more often than in other regions.
If the size for the young generation is too small, then a lot of minor
garbage collections are performed.
If the size is too large, then only full garbage collections are
performed, which can take a long time to complete.
It is recommended that you do not set the size for the young generation
for the G1 collector, and keep the size for the young generation greater
than 25% and less than 50% of the overall heap size for other
collectors.
The following examples show how to set the initial and maximum size of
young generation to 256 MB using various units:
.RS
.IP
.nf
\f[CB]
-Xmn256m
-Xmn262144k
-Xmn268435456
\f[R]
.fi
.PP
Instead of the \f[V]-Xmn\f[R] option to set both the initial and maximum
size of the heap for the young generation, you can use
\f[V]-XX:NewSize\f[R] to set the initial size and
\f[V]-XX:MaxNewSize\f[R] to set the maximum size.
.RE
.TP
\f[V]-Xms\f[R] \f[I]size\f[R]
Sets the minimum and the initial size (in bytes) of the heap.
This value must be a multiple of 1024 and greater than 1 MB.
Append the letter \f[V]k\f[R] or \f[V]K\f[R] to indicate kilobytes,
\f[V]m\f[R] or \f[V]M\f[R] to indicate megabytes, or \f[V]g\f[R] or
\f[V]G\f[R] to indicate gigabytes.
The following examples show how to set the size of allocated memory to 6
MB using various units:
.RS
.IP
.nf
\f[CB]
-Xms6291456
-Xms6144k
-Xms6m
\f[R]
.fi
.PP
If you do not set this option, then the initial size will be set as the
sum of the sizes allocated for the old generation and the young
generation.
The initial size of the heap for the young generation can be set using
the \f[V]-Xmn\f[R] option or the \f[V]-XX:NewSize\f[R] option.
.PP
Note that the \f[V]-XX:InitialHeapSize\f[R] option can also be used to
set the initial heap size.
If it appears after \f[V]-Xms\f[R] on the command line, then the initial
heap size gets set to the value specified with
\f[V]-XX:InitialHeapSize\f[R].
.RE
.TP
\f[V]-Xmx\f[R] \f[I]size\f[R]
Specifies the maximum size (in bytes) of the heap.
This value must be a multiple of 1024 and greater than 2 MB.
Append the letter \f[V]k\f[R] or \f[V]K\f[R] to indicate kilobytes,
\f[V]m\f[R] or \f[V]M\f[R] to indicate megabytes, or \f[V]g\f[R] or
\f[V]G\f[R] to indicate gigabytes.
The default value is chosen at runtime based on system configuration.
For server deployments, \f[V]-Xms\f[R] and \f[V]-Xmx\f[R] are often set
to the same value.
The following examples show how to set the maximum allowed size of
allocated memory to 80 MB using various units:
.RS
.IP
.nf
\f[CB]
-Xmx83886080
-Xmx81920k
-Xmx80m
\f[R]
.fi
.PP
The \f[V]-Xmx\f[R] option is equivalent to \f[V]-XX:MaxHeapSize\f[R].
.RE
.TP
\f[V]-Xnoclassgc\f[R]
Disables garbage collection (GC) of classes.
This can save some GC time, which shortens interruptions during the
application run.
When you specify \f[V]-Xnoclassgc\f[R] at startup, the class objects in
the application are left untouched during GC and are always be
considered live.
This can result in more memory being permanently occupied which, if not
used carefully, throws an out-of-memory exception.
.TP
\f[V]-Xrs\f[R]
Reduces the use of operating system signals by the JVM.
Shutdown hooks enable the orderly shutdown of a Java application by
running user cleanup code (such as closing database connections) at
shutdown, even if the JVM terminates abruptly.
.RS
.IP \[bu] 2
\f[B]Non-Windows:\f[R]
.RS 2
.IP \[bu] 2
The JVM catches signals to implement shutdown hooks for unexpected
termination.
The JVM uses \f[V]SIGHUP\f[R], \f[V]SIGINT\f[R], and \f[V]SIGTERM\f[R]
to initiate the running of shutdown hooks.
.IP \[bu] 2
Applications embedding the JVM frequently need to trap signals such as
\f[V]SIGINT\f[R] or \f[V]SIGTERM\f[R], which can lead to interference
with the JVM signal handlers.
The \f[V]-Xrs\f[R] option is available to address this issue.
When \f[V]-Xrs\f[R] is used, the signal masks for \f[V]SIGINT\f[R],
\f[V]SIGTERM\f[R], \f[V]SIGHUP\f[R], and \f[V]SIGQUIT\f[R] aren\[aq]t
changed by the JVM, and signal handlers for these signals aren\[aq]t
installed.
.RE
.IP \[bu] 2
\f[B]Windows:\f[R]
.RS 2
.IP \[bu] 2
The JVM watches for console control events to implement shutdown hooks
for unexpected termination.
Specifically, the JVM registers a console control handler that begins
shutdown-hook processing and returns \f[V]TRUE\f[R] for
\f[V]CTRL_C_EVENT\f[R], \f[V]CTRL_CLOSE_EVENT\f[R],
\f[V]CTRL_LOGOFF_EVENT\f[R], and \f[V]CTRL_SHUTDOWN_EVENT\f[R].
.IP \[bu] 2
The JVM uses a similar mechanism to implement the feature of dumping
thread stacks for debugging purposes.
The JVM uses \f[V]CTRL_BREAK_EVENT\f[R] to perform thread dumps.
.IP \[bu] 2
If the JVM is run as a service (for example, as a servlet engine for a
web server), then it can receive \f[V]CTRL_LOGOFF_EVENT\f[R] but
shouldn\[aq]t initiate shutdown because the operating system doesn\[aq]t
actually terminate the process.
To avoid possible interference such as this, the \f[V]-Xrs\f[R] option
can be used.
When the \f[V]-Xrs\f[R] option is used, the JVM doesn\[aq]t install a
console control handler, implying that it doesn\[aq]t watch for or
process \f[V]CTRL_C_EVENT\f[R], \f[V]CTRL_CLOSE_EVENT\f[R],
\f[V]CTRL_LOGOFF_EVENT\f[R], or \f[V]CTRL_SHUTDOWN_EVENT\f[R].
.RE
.PP
There are two consequences of specifying \f[V]-Xrs\f[R]:
.IP \[bu] 2
\f[B]Non-Windows:\f[R] \f[V]SIGQUIT\f[R] thread dumps aren\[aq]t
available.
.IP \[bu] 2
\f[B]Windows:\f[R] Ctrl + Break thread dumps aren\[aq]t available.
.PP
User code is responsible for causing shutdown hooks to run, for example,
by calling \f[V]System.exit()\f[R] when the JVM is to be terminated.
.RE
.TP
\f[V]-Xshare:\f[R]\f[I]mode\f[R]
Sets the class data sharing (CDS) mode.
.RS
.PP
Possible \f[I]mode\f[R] arguments for this option include the following:
.TP
\f[V]auto\f[R]
Use shared class data if possible (default).
.TP
\f[V]on\f[R]
Require using shared class data, otherwise fail.
.RS
.PP
\f[B]Note:\f[R] The \f[V]-Xshare:on\f[R] option is used for testing
purposes only.
It may cause the VM to unexpectedly exit during start-up when the CDS
archive cannot be used (for example, when certain VM parameters are
changed, or when a different JDK is used).
This option should not be used in production environments.
.RE
.TP
\f[V]off\f[R]
Do not attempt to use shared class data.
.RE
.TP
\f[V]-XshowSettings\f[R]
Shows all settings and then continues.
.TP
\f[V]-XshowSettings:\f[R]\f[I]category\f[R]
Shows settings and continues.
Possible \f[I]category\f[R] arguments for this option include the
following:
.RS
.TP
\f[V]all\f[R]
Shows all categories of settings.
This is the default value.
.TP
\f[V]locale\f[R]
Shows settings related to locale.
.TP
\f[V]properties\f[R]
Shows settings related to system properties.
.TP
\f[V]vm\f[R]
Shows the settings of the JVM.
.TP
\f[V]system\f[R]
\f[B]Linux only:\f[R] Shows host system or container configuration and
continues.
.RE
.TP
\f[V]-Xss\f[R] \f[I]size\f[R]
Sets the thread stack size (in bytes).
Append the letter \f[V]k\f[R] or \f[V]K\f[R] to indicate KB, \f[V]m\f[R]
or \f[V]M\f[R] to indicate MB, or \f[V]g\f[R] or \f[V]G\f[R] to indicate
GB.
The actual size may be rounded up to a multiple of the system page size
as required by the operating system.
The default value depends on the platform.
For example:
.RS
.IP \[bu] 2
Linux/x64: 1024 KB
.IP \[bu] 2
Linux/Aarch64: 2048 KB
.IP \[bu] 2
macOS/x64: 1024 KB
.IP \[bu] 2
macOS/Aarch64: 2048 KB
.IP \[bu] 2
Windows: The default value depends on virtual memory
.PP
The following examples set the thread stack size to 1024 KB in different
units:
.IP
.nf
\f[CB]
-Xss1m
-Xss1024k
-Xss1048576
\f[R]
.fi
.PP
This option is similar to \f[V]-XX:ThreadStackSize\f[R].
.RE
.TP
\f[V]--add-reads\f[R] \f[I]module\f[R]\f[V]=\f[R]\f[I]target-module\f[R](\f[V],\f[R]\f[I]target-module\f[R])*
Updates \f[I]module\f[R] to read the \f[I]target-module\f[R], regardless
of the module declaration.
\f[I]target-module\f[R] can be all unnamed to read all unnamed modules.
.TP
\f[V]--add-exports\f[R] \f[I]module\f[R]\f[V]/\f[R]\f[I]package\f[R]\f[V]=\f[R]\f[I]target-module\f[R](\f[V],\f[R]\f[I]target-module\f[R])*
Updates \f[I]module\f[R] to export \f[I]package\f[R] to
\f[I]target-module\f[R], regardless of module declaration.
The \f[I]target-module\f[R] can be all unnamed to export to all unnamed
modules.
.TP
\f[V]--add-opens\f[R] \f[I]module\f[R]\f[V]/\f[R]\f[I]package\f[R]\f[V]=\f[R]\f[I]target-module\f[R](\f[V],\f[R]\f[I]target-module\f[R])*
Updates \f[I]module\f[R] to open \f[I]package\f[R] to
\f[I]target-module\f[R], regardless of module declaration.
.TP
\f[V]--limit-modules\f[R] \f[I]module\f[R][\f[V],\f[R]\f[I]module\f[R]...]
Specifies the limit of the universe of observable modules.
.TP
\f[V]--patch-module\f[R] \f[I]module\f[R]\f[V]=\f[R]\f[I]file\f[R](\f[V];\f[R]\f[I]file\f[R])*
Overrides or augments a module with classes and resources in JAR files
or directories.
.TP
\f[V]--source\f[R] \f[I]version\f[R]
Sets the version of the source in source-file mode.
.SH EXTRA OPTIONS FOR MACOS
.PP
The following extra options are macOS specific.
.TP
\f[V]-XstartOnFirstThread\f[R]
Runs the \f[V]main()\f[R] method on the first (AppKit) thread.
.TP
\f[V]-Xdock:name=\f[R]\f[I]application_name\f[R]
Overrides the default application name displayed in dock.
.TP
\f[V]-Xdock:icon=\f[R]\f[I]path_to_icon_file\f[R]
Overrides the default icon displayed in dock.
.SH ADVANCED OPTIONS FOR JAVA
.PP
These \f[V]java\f[R] options can be used to enable other advanced
options.
.TP
\f[V]-XX:+UnlockDiagnosticVMOptions\f[R]
Unlocks the options intended for diagnosing the JVM.
By default, this option is disabled and diagnostic options aren\[aq]t
available.
.RS
.PP
Command line options that are enabled with the use of this option are
not supported.
If you encounter issues while using any of these options, it is very
likely that you will be required to reproduce the problem without using
any of these unsupported options before Oracle Support can assist with
an investigation.
It is also possible that any of these options may be removed or their
behavior changed without any warning.
.RE
.TP
\f[V]-XX:+UnlockExperimentalVMOptions\f[R]
Unlocks the options that provide experimental features in the JVM.
By default, this option is disabled and experimental features aren\[aq]t
available.
.SH ADVANCED RUNTIME OPTIONS FOR JAVA
.PP
These \f[V]java\f[R] options control the runtime behavior of the Java
HotSpot VM.
.TP
\f[V]-XX:ActiveProcessorCount=\f[R]\f[I]x\f[R]
Overrides the number of CPUs that the VM will use to calculate the size
of thread pools it will use for various operations such as Garbage
Collection and ForkJoinPool.
.RS
.PP
The VM normally determines the number of available processors from the
operating system.
This flag can be useful for partitioning CPU resources when running
multiple Java processes in docker containers.
This flag is honored even if \f[V]UseContainerSupport\f[R] is not
enabled.
See \f[V]-XX:-UseContainerSupport\f[R] for a description of enabling and
disabling container support.
.RE
.TP
\f[V]-XX:AllocateHeapAt=\f[R]\f[I]path\f[R]
Takes a path to the file system and uses memory mapping to allocate the
object heap on the memory device.
Using this option enables the HotSpot VM to allocate the Java object
heap on an alternative memory device, such as an NV-DIMM, specified by
the user.
.RS
.PP
Alternative memory devices that have the same semantics as DRAM,
including the semantics of atomic operations, can be used instead of
DRAM for the object heap without changing the existing application code.
All other memory structures (such as the code heap, metaspace, and
thread stacks) continue to reside in DRAM.
.PP
Some operating systems expose non-DRAM memory through the file system.
Memory-mapped files in these file systems bypass the page cache and
provide a direct mapping of virtual memory to the physical memory on the
device.
The existing heap related flags (such as \f[V]-Xmx\f[R] and
\f[V]-Xms\f[R]) and garbage-collection related flags continue to work as
before.
.RE
.TP
\f[V]-XX:-CompactStrings\f[R]
Disables the Compact Strings feature.
By default, this option is enabled.
When this option is enabled, Java Strings containing only single-byte
characters are internally represented and stored as
single-byte-per-character Strings using ISO-8859-1 / Latin-1 encoding.
This reduces, by 50%, the amount of space required for Strings
containing only single-byte characters.
For Java Strings containing at least one multibyte character: these are
represented and stored as 2 bytes per character using UTF-16 encoding.
Disabling the Compact Strings feature forces the use of UTF-16 encoding
as the internal representation for all Java Strings.
.RS
.PP
Cases where it may be beneficial to disable Compact Strings include the
following:
.IP \[bu] 2
When it\[aq]s known that an application overwhelmingly will be
allocating multibyte character Strings
.IP \[bu] 2
In the unexpected event where a performance regression is observed in
migrating from Java SE 8 to Java SE 9 and an analysis shows that Compact
Strings introduces the regression
.PP
In both of these scenarios, disabling Compact Strings makes sense.
.RE
.TP
\f[V]-XX:ErrorFile=\f[R]\f[I]filename\f[R]
Specifies the path and file name to which error data is written when an
irrecoverable error occurs.
By default, this file is created in the current working directory and
named \f[V]hs_err_pid\f[R]\f[I]pid\f[R]\f[V].log\f[R] where
\f[I]pid\f[R] is the identifier of the process that encountered the
error.
.RS
.PP
The following example shows how to set the default log file (note that
the identifier of the process is specified as \f[V]%p\f[R]):
.RS
.PP
\f[V]-XX:ErrorFile=./hs_err_pid%p.log\f[R]
.RE
.IP \[bu] 2
\f[B]Non-Windows:\f[R] The following example shows how to set the error
log to \f[V]/var/log/java/java_error.log\f[R]:
.RS 2
.RS
.PP
\f[V]-XX:ErrorFile=/var/log/java/java_error.log\f[R]
.RE
.RE
.IP \[bu] 2
\f[B]Windows:\f[R] The following example shows how to set the error log
file to \f[V]C:/log/java/java_error.log\f[R]:
.RS 2
.RS
.PP
\f[V]-XX:ErrorFile=C:/log/java/java_error.log\f[R]
.RE
.RE
.PP
If the file exists, and is writeable, then it will be overwritten.
Otherwiseif the file can\[aq]t be created in the specified directory
(due to insufficient space, permission problem, or another issue), then
the file is created in the temporary directory for the operating system:
.IP \[bu] 2
\f[B]Non-Windows:\f[R] The temporary directory is \f[V]/tmp\f[R].
.IP \[bu] 2
\f[B]Windows:\f[R] The temporary directory is specified by the value of
the \f[V]TMP\f[R] environment variable; if that environment variable
isn\[aq]t defined, then the value of the \f[V]TEMP\f[R] environment
variable is used.
.RE
.TP
\f[V]-XX:+ExtensiveErrorReports\f[R]
Enables the reporting of more extensive error information in the
\f[V]ErrorFile\f[R].
This option can be turned on in environments where maximal information
is desired - even if the resulting logs may be quite large and/or
contain information that might be considered sensitive.
The information can vary from release to release, and across different
platforms.
By default this option is disabled.
.TP
\f[V]-XX:FlightRecorderOptions=\f[R]\f[I]parameter\f[R]\f[V]=\f[R]\f[I]value\f[R] (or) \f[V]-XX:FlightRecorderOptions:\f[R]\f[I]parameter\f[R]\f[V]=\f[R]\f[I]value\f[R]
Sets the parameters that control the behavior of JFR.
.RS
.PP
The following list contains the available JFR
\f[I]parameter\f[R]\f[V]=\f[R]\f[I]value\f[R] entries:
.TP
\f[V]globalbuffersize=\f[R]\f[I]size\f[R]
Specifies the total amount of primary memory used for data retention.
The default value is based on the value specified for
\f[V]memorysize\f[R].
Change the \f[V]memorysize\f[R] parameter to alter the size of global
buffers.
.TP
\f[V]maxchunksize=\f[R]\f[I]size\f[R]
Specifies the maximum size (in bytes) of the data chunks in a recording.
Append \f[V]m\f[R] or \f[V]M\f[R] to specify the size in megabytes (MB),
or \f[V]g\f[R] or \f[V]G\f[R] to specify the size in gigabytes (GB).
By default, the maximum size of data chunks is set to 12 MB.
The minimum allowed is 1 MB.
.TP
\f[V]memorysize=\f[R]\f[I]size\f[R]
Determines how much buffer memory should be used, and sets the
\f[V]globalbuffersize\f[R] and \f[V]numglobalbuffers\f[R] parameters
based on the size specified.
Append \f[V]m\f[R] or \f[V]M\f[R] to specify the size in megabytes (MB),
or \f[V]g\f[R] or \f[V]G\f[R] to specify the size in gigabytes (GB).
By default, the memory size is set to 10 MB.
.TP
\f[V]numglobalbuffers\f[R]
Specifies the number of global buffers used.
The default value is based on the memory size specified.
Change the \f[V]memorysize\f[R] parameter to alter the number of global
buffers.
.TP
\f[V]old-object-queue-size=number-of-objects\f[R]
Maximum number of old objects to track.
By default, the number of objects is set to 256.
.TP
\f[V]repository=\f[R]\f[I]path\f[R]
Specifies the repository (a directory) for temporary disk storage.
By default, the system\[aq]s temporary directory is used.
.TP
\f[V]retransform=\f[R]{\f[V]true\f[R]|\f[V]false\f[R]}
Specifies whether event classes should be retransformed using JVMTI.
If false, instrumentation is added when event classes are loaded.
By default, this parameter is enabled.
.TP
\f[V]stackdepth=\f[R]\f[I]depth\f[R]
Stack depth for stack traces.
By default, the depth is set to 64 method calls.
The maximum is 2048.
Values greater than 64 could create significant overhead and reduce
performance.
.TP
\f[V]threadbuffersize=\f[R]\f[I]size\f[R]
Specifies the per-thread local buffer size (in bytes).
By default, the local buffer size is set to 8 kilobytes, with a minimum
value of 4 kilobytes.
Overriding this parameter could reduce performance and is not
recommended.
.PP
You can specify values for multiple parameters by separating them with a
comma.
.RE
.TP
\f[V]-XX:LargePageSizeInBytes=\f[R]\f[I]size\f[R]
Sets the maximum large page size (in bytes) used by the JVM.
The \f[I]size\f[R] argument must be a valid page size supported by the
environment to have any effect.
Append the letter \f[V]k\f[R] or \f[V]K\f[R] to indicate kilobytes,
\f[V]m\f[R] or \f[V]M\f[R] to indicate megabytes, or \f[V]g\f[R] or
\f[V]G\f[R] to indicate gigabytes.
By default, the size is set to 0, meaning that the JVM will use the
default large page size for the environment as the maximum size for
large pages.
See \f[B]Large Pages\f[R].
.RS
.PP
The following example describes how to set the large page size to 1
gigabyte (GB):
.RS
.PP
\f[V]-XX:LargePageSizeInBytes=1g\f[R]
.RE
.RE
.TP
\f[V]-XX:MaxDirectMemorySize=\f[R]\f[I]size\f[R]
Sets the maximum total size (in bytes) of the \f[V]java.nio\f[R]
package, direct-buffer allocations.
Append the letter \f[V]k\f[R] or \f[V]K\f[R] to indicate kilobytes,
\f[V]m\f[R] or \f[V]M\f[R] to indicate megabytes, or \f[V]g\f[R] or
\f[V]G\f[R] to indicate gigabytes.
If not set, the flag is ignored and the JVM chooses the size for NIO
direct-buffer allocations automatically.
.RS
.PP
The following examples illustrate how to set the NIO size to 1024 KB in
different units:
.IP
.nf
\f[CB]
-XX:MaxDirectMemorySize=1m
-XX:MaxDirectMemorySize=1024k
-XX:MaxDirectMemorySize=1048576
\f[R]
.fi
.RE
.TP
\f[V]-XX:-MaxFDLimit\f[R]
Disables the attempt to set the soft limit for the number of open file
descriptors to the hard limit.
By default, this option is enabled on all platforms, but is ignored on
Windows.
The only time that you may need to disable this is on macOS, where its
use imposes a maximum of 10240, which is lower than the actual system
maximum.
.TP
\f[V]-XX:NativeMemoryTracking=\f[R]\f[I]mode\f[R]
Specifies the mode for tracking JVM native memory usage.
Possible \f[I]mode\f[R] arguments for this option include the following:
.RS
.TP
\f[V]off\f[R]
Instructs not to track JVM native memory usage.
This is the default behavior if you don\[aq]t specify the
\f[V]-XX:NativeMemoryTracking\f[R] option.
.TP
\f[V]summary\f[R]
Tracks memory usage only by JVM subsystems, such as Java heap, class,
code, and thread.
.TP
\f[V]detail\f[R]
In addition to tracking memory usage by JVM subsystems, track memory
usage by individual \f[V]CallSite\f[R], individual virtual memory region
and its committed regions.
.RE
.TP
\f[V]-XX:+NeverActAsServerClassMachine\f[R]
Enable the \[dq]Client VM emulation\[dq] mode which only uses the C1 JIT
compiler, a 32Mb CodeCache and the Serial GC.
The maximum amount of memory that the JVM may use (controlled by the
\f[V]-XX:MaxRAM=n\f[R] flag) is set to 1GB by default.
The string \[dq]emulated-client\[dq] is added to the JVM version string.
.RS
.PP
By default the flag is set to \f[V]true\f[R] only on Windows in 32-bit
mode and \f[V]false\f[R] in all other cases.
.PP
The \[dq]Client VM emulation\[dq] mode will not be enabled if any of the
following flags are used on the command line:
.IP
.nf
\f[CB]
-XX:{+|-}TieredCompilation
-XX:CompilationMode=mode
-XX:TieredStopAtLevel=n
-XX:{+|-}EnableJVMCI
-XX:{+|-}UseJVMCICompiler
\f[R]
.fi
.RE
.TP
\f[V]-XX:ObjectAlignmentInBytes=\f[R]\f[I]alignment\f[R]
Sets the memory alignment of Java objects (in bytes).
By default, the value is set to 8 bytes.
The specified value should be a power of 2, and must be within the range
of 8 and 256 (inclusive).
This option makes it possible to use compressed pointers with large Java
heap sizes.
.RS
.PP
The heap size limit in bytes is calculated as:
.RS
.PP
\f[V]4GB * ObjectAlignmentInBytes\f[R]
.RE
.RS
.PP
\f[B]Note:\f[R] As the alignment value increases, the unused space
between objects also increases.
As a result, you may not realize any benefits from using compressed
pointers with large Java heap sizes.
.RE
.RE
.TP
\f[V]-XX:OnError=\f[R]\f[I]string\f[R]
Sets a custom command or a series of semicolon-separated commands to run
when an irrecoverable error occurs.
If the string contains spaces, then it must be enclosed in quotation
marks.
.RS
.IP \[bu] 2
\f[B]Non-Windows:\f[R] The following example shows how the
\f[V]-XX:OnError\f[R] option can be used to run the \f[V]gcore\f[R]
command to create a core image, and start the \f[V]gdb\f[R] debugger to
attach to the process in case of an irrecoverable error (the
\f[V]%p\f[R] designates the current process identifier):
.RS 2
.RS
.PP
\f[V]-XX:OnError=\[dq]gcore %p;gdb -p %p\[dq]\f[R]
.RE
.RE
.IP \[bu] 2
\f[B]Windows:\f[R] The following example shows how the
\f[V]-XX:OnError\f[R] option can be used to run the
\f[V]userdump.exe\f[R] utility to obtain a crash dump in case of an
irrecoverable error (the \f[V]%p\f[R] designates the current process
identifier).
This example assumes that the path to the \f[V]userdump.exe\f[R] utility
is specified in the \f[V]PATH\f[R] environment variable:
.RS 2
.RS
.PP
\f[V]-XX:OnError=\[dq]userdump.exe %p\[dq]\f[R]
.RE
.RE
.RE
.TP
\f[V]-XX:OnOutOfMemoryError=\f[R]\f[I]string\f[R]
Sets a custom command or a series of semicolon-separated commands to run
when an \f[V]OutOfMemoryError\f[R] exception is first thrown.
If the string contains spaces, then it must be enclosed in quotation
marks.
For an example of a command string, see the description of the
\f[V]-XX:OnError\f[R] option.
.TP
\f[V]-XX:+PrintCommandLineFlags\f[R]
Enables printing of ergonomically selected JVM flags that appeared on
the command line.
It can be useful to know the ergonomic values set by the JVM, such as
the heap space size and the selected garbage collector.
By default, this option is disabled and flags aren\[aq]t printed.
.TP
\f[V]-XX:+PreserveFramePointer\f[R]
Selects between using the RBP register as a general purpose register
(\f[V]-XX:-PreserveFramePointer\f[R]) and using the RBP register to hold
the frame pointer of the currently executing method
(\f[V]-XX:+PreserveFramePointer\f[R] .
If the frame pointer is available, then external profiling tools (for
example, Linux perf) can construct more accurate stack traces.
.TP
\f[V]-XX:+PrintNMTStatistics\f[R]
Enables printing of collected native memory tracking data at JVM exit
when native memory tracking is enabled (see
\f[V]-XX:NativeMemoryTracking\f[R]).
By default, this option is disabled and native memory tracking data
isn\[aq]t printed.
.TP
\f[V]-XX:SharedArchiveFile=\f[R]\f[I]path\f[R]
Specifies the path and name of the class data sharing (CDS) archive file
.RS
.PP
See \f[B]Application Class Data Sharing\f[R].
.RE
.TP
\f[V]-XX:SharedArchiveConfigFile=\f[R]\f[I]shared_config_file\f[R]
Specifies additional shared data added to the archive file.
.TP
\f[V]-XX:SharedClassListFile=\f[R]\f[I]file_name\f[R]
Specifies the text file that contains the names of the classes to store
in the class data sharing (CDS) archive.
This file contains the full name of one class per line, except slashes
(\f[V]/\f[R]) replace dots (\f[V].\f[R]).
For example, to specify the classes \f[V]java.lang.Object\f[R] and
\f[V]hello.Main\f[R], create a text file that contains the following two
lines:
.RS
.IP
.nf
\f[CB]
java/lang/Object
hello/Main
\f[R]
.fi
.PP
The classes that you specify in this text file should include the
classes that are commonly used by the application.
They may include any classes from the application, extension, or
bootstrap class paths.
.PP
See \f[B]Application Class Data Sharing\f[R].
.RE
.TP
\f[V]-XX:+ShowCodeDetailsInExceptionMessages\f[R]
Enables printing of improved \f[V]NullPointerException\f[R] messages.
When an application throws a \f[V]NullPointerException\f[R], the option
enables the JVM to analyze the program\[aq]s bytecode instructions to
determine precisely which reference is \f[V]null\f[R], and describes the
source with a null-detail message.
The null-detail message is calculated and returned by
\f[V]NullPointerException.getMessage()\f[R], and will be printed as the
exception message along with the method, filename, and line number.
By default, this option is enabled.
.TP
\f[V]-XX:+ShowMessageBoxOnError\f[R]
Enables the display of a dialog box when the JVM experiences an
irrecoverable error.
This prevents the JVM from exiting and keeps the process active so that
you can attach a debugger to it to investigate the cause of the error.
By default, this option is disabled.
.TP
\f[V]-XX:StartFlightRecording=\f[R]\f[I]parameter\f[R]\f[V]=\f[R]\f[I]value\f[R]
Starts a JFR recording for the Java application.
This option is equivalent to the \f[V]JFR.start\f[R] diagnostic command
that starts a recording during runtime.
You can set the following \f[I]parameter\f[R]\f[V]=\f[R]\f[I]value\f[R]
entries when starting a JFR recording:
.RS
.TP
\f[V]delay=\f[R]\f[I]time\f[R]
Specifies the delay between the Java application launch time and the
start of the recording.
Append \f[V]s\f[R] to specify the time in seconds, \f[V]m\f[R] for
minutes, \f[V]h\f[R] for hours, or \f[V]d\f[R] for days (for example,
specifying \f[V]10m\f[R] means 10 minutes).
By default, there\[aq]s no delay, and this parameter is set to 0.
.TP
\f[V]disk=\f[R]{\f[V]true\f[R]|\f[V]false\f[R]}
Specifies whether to write data to disk while recording.
By default, this parameter is enabled.
.TP
\f[V]dumponexit=\f[R]{\f[V]true\f[R]|\f[V]false\f[R]}
Specifies if the running recording is dumped when the JVM shuts down.
If enabled and a \f[V]filename\f[R] is not entered, the recording is
written to a file in the directory where the process was started.
The file name is a system-generated name that contains the process ID,
recording ID, and current timestamp, similar to
\f[V]hotspot-pid-47496-id-1-2018_01_25_19_10_41.jfr\f[R].
By default, this parameter is disabled.
.TP
\f[V]duration=\f[R]\f[I]time\f[R]
Specifies the duration of the recording.
Append \f[V]s\f[R] to specify the time in seconds, \f[V]m\f[R] for
minutes, \f[V]h\f[R] for hours, or \f[V]d\f[R] for days (for example,
specifying \f[V]5h\f[R] means 5 hours).
By default, the duration isn\[aq]t limited, and this parameter is set to
0.
.TP
\f[V]filename=\f[R]\f[I]path\f[R]
Specifies the path and name of the file to which the recording is
written when the recording is stopped, for example:
.RS
.IP \[bu] 2
\f[V]recording.jfr\f[R]
.IP \[bu] 2
\f[V]/home/user/recordings/recording.jfr\f[R]
.IP \[bu] 2
\f[V]c:\[rs]recordings\[rs]recording.jfr\f[R]
.RE
.TP
\f[V]name=\f[R]\f[I]identifier\f[R]
Takes both the name and the identifier of a recording.
.TP
\f[V]maxage=\f[R]\f[I]time\f[R]
Specifies the maximum age of disk data to keep for the recording.
This parameter is valid only when the \f[V]disk\f[R] parameter is set to
\f[V]true\f[R].
Append \f[V]s\f[R] to specify the time in seconds, \f[V]m\f[R] for
minutes, \f[V]h\f[R] for hours, or \f[V]d\f[R] for days (for example,
specifying \f[V]30s\f[R] means 30 seconds).
By default, the maximum age isn\[aq]t limited, and this parameter is set
to \f[V]0s\f[R].
.TP
\f[V]maxsize=\f[R]\f[I]size\f[R]
Specifies the maximum size (in bytes) of disk data to keep for the
recording.
This parameter is valid only when the \f[V]disk\f[R] parameter is set to
\f[V]true\f[R].
The value must not be less than the value for the \f[V]maxchunksize\f[R]
parameter set with \f[V]-XX:FlightRecorderOptions\f[R].
Append \f[V]m\f[R] or \f[V]M\f[R] to specify the size in megabytes, or
\f[V]g\f[R] or \f[V]G\f[R] to specify the size in gigabytes.
By default, the maximum size of disk data isn\[aq]t limited, and this
parameter is set to \f[V]0\f[R].
.TP
\f[V]path-to-gc-roots=\f[R]{\f[V]true\f[R]|\f[V]false\f[R]}
Specifies whether to collect the path to garbage collection (GC) roots
at the end of a recording.
By default, this parameter is disabled.
.RS
.PP
The path to GC roots is useful for finding memory leaks, but collecting
it is time-consuming.
Enable this option only when you start a recording for an application
that you suspect has a memory leak.
If the \f[V]settings\f[R] parameter is set to \f[V]profile\f[R], the
stack trace from where the potential leaking object was allocated is
included in the information collected.
.RE
.TP
\f[V]settings=\f[R]\f[I]path\f[R]
Specifies the path and name of the event settings file (of type JFC).
By default, the \f[V]default.jfc\f[R] file is used, which is located in
\f[V]JAVA_HOME/lib/jfr\f[R].
This default settings file collects a predefined set of information with
low overhead, so it has minimal impact on performance and can be used
with recordings that run continuously.
.RS
.PP
A second settings file is also provided, profile.jfc, which provides
more data than the default configuration, but can have more overhead and
impact performance.
Use this configuration for short periods of time when more information
is needed.
.RE
.PP
You can specify values for multiple parameters by separating them with a
comma.
Event settings and .jfc options can be specified using the following
syntax:
.TP
\f[V]option=\f[R]\f[I]value\f[R]
Specifies the option value to modify.
To list available options, use the \f[V]JAVA_HOME\f[R]/bin/jfr tool.
.TP
\f[V]event-setting=\f[R]\f[I]value\f[R]
Specifies the event setting value to modify.
Use the form: \f[V]<event-name>#<setting-name>=<value>\f[R].
To add a new event setting, prefix the event name with \[aq]+\[aq].
.PP
You can specify values for multiple event settings and .jfc options by
separating them with a comma.
In case of a conflict between a parameter and a .jfc option, the
parameter will take precedence.
The whitespace delimiter can be omitted for timespan values, i.e.
20ms.
For more information about the settings syntax, see Javadoc of the
jdk.jfr package.
.RE
.TP
\f[V]-XX:ThreadStackSize=\f[R]\f[I]size\f[R]
Sets the Java thread stack size (in kilobytes).
Use of a scaling suffix, such as \f[V]k\f[R], results in the scaling of
the kilobytes value so that \f[V]-XX:ThreadStackSize=1k\f[R] sets the
--> --------------------

--> maximum size reached

--> --------------------

[ zur Elbe Produktseite wechseln0.313Quellennavigators  ]