8297164: Update troff man pages and CheckManPageOptions.java

Reviewed-by: dholmes
This commit is contained in:
Jonathan Gibbons 2022-11-21 22:03:48 +00:00
parent f12710e938
commit 5a45c25151
29 changed files with 7389 additions and 8505 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -19,39 +19,49 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "RMIREGISTRY" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "RMIREGISTRY" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
rmiregistry \- create and start a remote object registry on the rmiregistry - create and start a remote object registry on the specified
specified port on the current host port on the current host
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]rmiregistry\f[R] [\f[I]options\f[R]] [\f[I]port\f[R]] \f[V]rmiregistry\f[R] [\f[I]options\f[R]] [\f[I]port\f[R]]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
This represents the option for the \f[CB]rmiregistry\f[R] command. This represents the option for the \f[V]rmiregistry\f[R] command.
See \f[B]Options\f[R] See \f[B]Options\f[R]
.RS
.RE
.TP .TP
.B \f[I]port\f[R] \f[I]port\f[R]
The number of a port on the current host at which to start the remote The number of a port on the current host at which to start the remote
object registry. object registry.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]rmiregistry\f[R] command creates and starts a remote object The \f[V]rmiregistry\f[R] command creates and starts a remote object
registry on the specified port on the current host. registry on the specified port on the current host.
If the port is omitted, then the registry is started on port 1099. If the port is omitted, then the registry is started on port 1099.
The \f[CB]rmiregistry\f[R] command produces no output and is typically run The \f[V]rmiregistry\f[R] command produces no output and is typically
in the background, for example: run in the background, for example:
.RS .RS
.PP .PP
\f[CB]rmiregistry\ &\f[R] \f[V]rmiregistry &\f[R]
.RE .RE
.PP .PP
A remote object registry is a bootstrap naming service that\[aq]s used A remote object registry is a bootstrap naming service that\[aq]s used
@ -61,14 +71,14 @@ make remote method invocations.
.PP .PP
The registry is typically used to locate the first remote object on The registry is typically used to locate the first remote object on
which an application needs to call methods. which an application needs to call methods.
That object then provides application\-specific support for finding That object then provides application-specific support for finding other
other objects. objects.
.PP .PP
The methods of the \f[CB]java.rmi.registry.LocateRegistry\f[R] class are The methods of the \f[V]java.rmi.registry.LocateRegistry\f[R] class are
used to get a registry operating on the local host or local host and used to get a registry operating on the local host or local host and
port. port.
.PP .PP
The URL\-based methods of the \f[CB]java.rmi.Naming\f[R] class operate on The URL-based methods of the \f[V]java.rmi.Naming\f[R] class operate on
a registry and can be used to: a registry and can be used to:
.IP \[bu] 2 .IP \[bu] 2
Bind the specified name to a remote object Bind the specified name to a remote object
@ -84,9 +94,7 @@ Destroy the binding for the specified name that\[aq]s associated with a
remote object remote object
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \f[CB]\-J\f[R]\f[I]option\f[R] \f[V]-J\f[R]\f[I]option\f[R]
Used with any Java option to pass the \f[I]option\f[R] following the Used with any Java option to pass the \f[I]option\f[R] following the
\f[CB]\-J\f[R] (no spaces between the \f[CB]\-J\f[R] and the option) to the \f[V]-J\f[R] (no spaces between the \f[V]-J\f[R] and the option) to the
Java interpreter. Java interpreter.
.RS
.RE

View file

@ -19,13 +19,27 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JRUNSCRIPT" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JRUNSCRIPT" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jrunscript \- run a command\-line script shell that supports interactive jrunscript - run a command-line script shell that supports interactive
and batch modes and batch modes
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
@ -33,143 +47,119 @@ and batch modes
.PP .PP
This tool is \f[B]experimental\f[R] and unsupported. This tool is \f[B]experimental\f[R] and unsupported.
.PP .PP
\f[CB]jrunscript\f[R] [\f[I]options\f[R]] [\f[I]arguments\f[R]] \f[V]jrunscript\f[R] [\f[I]options\f[R]] [\f[I]arguments\f[R]]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
This represents the \f[CB]jrunscript\f[R] command\-line options that can This represents the \f[V]jrunscript\f[R] command-line options that can
be used. be used.
See \f[B]Options for the jrunscript Command\f[R]. See \f[B]Options for the jrunscript Command\f[R].
.RS
.RE
.TP .TP
.B \f[I]arguments\f[R] \f[I]arguments\f[R]
Arguments, when used, follow immediately after options or the command Arguments, when used, follow immediately after options or the command
name. name.
See \f[B]Arguments\f[R]. See \f[B]Arguments\f[R].
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jrunscript\f[R] command is a language\-independent command\-line The \f[V]jrunscript\f[R] command is a language-independent command-line
script shell. script shell.
The \f[CB]jrunscript\f[R] command supports both an interactive The \f[V]jrunscript\f[R] command supports both an interactive
(read\-eval\-print) mode and a batch (\f[CB]\-f\f[R] option) mode of (read-eval-print) mode and a batch (\f[V]-f\f[R] option) mode of script
script execution. execution.
By default, JavaScript is the language used, but the \f[CB]\-l\f[R] option By default, JavaScript is the language used, but the \f[V]-l\f[R] option
can be used to specify a different language. can be used to specify a different language.
By using Java to scripting language communication, the By using Java to scripting language communication, the
\f[CB]jrunscript\f[R] command supports an exploratory programming style. \f[V]jrunscript\f[R] command supports an exploratory programming style.
.PP .PP
If JavaScript is used, then before it evaluates a user defined script, If JavaScript is used, then before it evaluates a user defined script,
the \f[CB]jrunscript\f[R] command initializes certain built\-in functions the \f[V]jrunscript\f[R] command initializes certain built-in functions
and objects, which are documented in the API Specification for and objects, which are documented in the API Specification for
\f[CB]jrunscript\f[R] JavaScript built\-in functions. \f[V]jrunscript\f[R] JavaScript built-in functions.
.SH OPTIONS FOR THE JRUNSCRIPT COMMAND .SH OPTIONS FOR THE JRUNSCRIPT COMMAND
.TP .TP
.B \f[CB]\-cp\f[R] \f[I]path\f[R] or \f[CB]\-classpath\f[R] \f[I]path\f[R] \f[V]-cp\f[R] \f[I]path\f[R] or \f[V]-classpath\f[R] \f[I]path\f[R]
Indicates where any class files are that the script needs to access. Indicates where any class files are that the script needs to access.
.RS
.RE
.TP .TP
.B \f[CB]\-D\f[R]\f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R] \f[V]-D\f[R]\f[I]name\f[R]\f[V]=\f[R]\f[I]value\f[R]
Sets a Java system property. Sets a Java system property.
.RS
.RE
.TP .TP
.B \f[CB]\-J\f[R]\f[I]flag\f[R] \f[V]-J\f[R]\f[I]flag\f[R]
Passes \f[I]flag\f[R] directly to the Java Virtual Machine where the Passes \f[I]flag\f[R] directly to the Java Virtual Machine where the
\f[CB]jrunscript\f[R] command is running. \f[V]jrunscript\f[R] command is running.
.RS
.RE
.TP .TP
.B \f[CB]\-l\f[R] \f[I]language\f[R] \f[V]-l\f[R] \f[I]language\f[R]
Uses the specified scripting language. Uses the specified scripting language.
By default, JavaScript is used. By default, JavaScript is used.
To use other scripting languages, you must specify the corresponding To use other scripting languages, you must specify the corresponding
script engine\[aq]s JAR file with the \f[CB]\-cp\f[R] or script engine\[aq]s JAR file with the \f[V]-cp\f[R] or
\f[CB]\-classpath\f[R] option. \f[V]-classpath\f[R] option.
.RS
.RE
.TP .TP
.B \f[CB]\-e\f[R] \f[I]script\f[R] \f[V]-e\f[R] \f[I]script\f[R]
Evaluates the specified script. Evaluates the specified script.
This option can be used to run one\-line scripts that are specified This option can be used to run one-line scripts that are specified
completely on the command line. completely on the command line.
.RS
.RE
.TP .TP
.B \f[CB]\-encoding\f[R] \f[I]encoding\f[R] \f[V]-encoding\f[R] \f[I]encoding\f[R]
Specifies the character encoding used to read script files. Specifies the character encoding used to read script files.
.RS
.RE
.TP .TP
.B \f[CB]\-f\f[R] \f[I]script\-file\f[R] \f[V]-f\f[R] \f[I]script-file\f[R]
Evaluates the specified script file (batch mode). Evaluates the specified script file (batch mode).
.RS
.RE
.TP .TP
.B \f[CB]\-f\ \-\f[R] \f[V]-f -\f[R]
Enters interactive mode to read and evaluate a script from standard Enters interactive mode to read and evaluate a script from standard
input. input.
.RS
.RE
.TP .TP
.B \f[CB]\-help\f[R] or \f[CB]\-?\f[R] \f[V]-help\f[R] or \f[V]-?\f[R]
Displays a help message and exits. Displays a help message and exits.
.RS
.RE
.TP .TP
.B \f[CB]\-q\f[R] \f[V]-q\f[R]
Lists all script engines available and exits. Lists all script engines available and exits.
.RS
.RE
.SH ARGUMENTS .SH ARGUMENTS
.PP .PP
If arguments are present and if no \f[CB]\-e\f[R] or \f[CB]\-f\f[R] option If arguments are present and if no \f[V]-e\f[R] or \f[V]-f\f[R] option
is used, then the first argument is the script file and the rest of the is used, then the first argument is the script file and the rest of the
arguments, if any, are passed as script arguments. arguments, if any, are passed as script arguments.
If arguments and the \f[CB]\-e\f[R] or the \f[CB]\-f\f[R] option are used, If arguments and the \f[V]-e\f[R] or the \f[V]-f\f[R] option are used,
then all arguments are passed as script arguments. then all arguments are passed as script arguments.
If arguments \f[CB]\-e\f[R] and \f[CB]\-f\f[R] are missing, then the If arguments \f[V]-e\f[R] and \f[V]-f\f[R] are missing, then the
interactive mode is used. interactive mode is used.
.SH EXAMPLE OF EXECUTING INLINE SCRIPTS .SH EXAMPLE OF EXECUTING INLINE SCRIPTS
.RS .RS
.PP .PP
\f[CB]jrunscript\ \-e\ "print(\[aq]hello\ world\[aq])"\f[R] \f[V]jrunscript -e \[dq]print(\[aq]hello world\[aq])\[dq]\f[R]
.RE .RE
.RS .RS
.PP .PP
\f[CB]jrunscript\ \-e\ "cat(\[aq]http://www.example.com\[aq])"\f[R] \f[V]jrunscript -e \[dq]cat(\[aq]http://www.example.com\[aq])\[dq]\f[R]
.RE .RE
.SH EXAMPLE OF USING SPECIFIED LANGUAGE AND EVALUATE THE SCRIPT FILE .SH EXAMPLE OF USING SPECIFIED LANGUAGE AND EVALUATE THE SCRIPT FILE
.RS .RS
.PP .PP
\f[CB]jrunscript\ \-l\ js\ \-f\ test.js\f[R] \f[V]jrunscript -l js -f test.js\f[R]
.RE .RE
.SH EXAMPLE OF INTERACTIVE MODE .SH EXAMPLE OF INTERACTIVE MODE
.IP .IP
.nf .nf
\f[CB] \f[CB]
jrunscript jrunscript
js>\ print(\[aq]Hello\ World\\n\[aq]); js> print(\[aq]Hello World\[rs]n\[aq]);
Hello\ World Hello World
js>\ 34\ +\ 55 js> 34 + 55
89.0 89.0
js>\ t\ =\ new\ java.lang.Thread(function()\ {\ print(\[aq]Hello\ World\\n\[aq]);\ }) js> t = new java.lang.Thread(function() { print(\[aq]Hello World\[rs]n\[aq]); })
Thread[Thread\-0,5,main] Thread[Thread-0,5,main]
js>\ t.start() js> t.start()
js>\ Hello\ World js> Hello World
js> js>
\f[R] \f[R]
.fi .fi
.SH RUN SCRIPT FILE WITH SCRIPT ARGUMENTS .SH RUN SCRIPT FILE WITH SCRIPT ARGUMENTS
.PP .PP
In this example, the \f[CB]test.js\f[R] file is the script file. In this example, the \f[V]test.js\f[R] file is the script file.
The \f[CB]arg1\f[R], \f[CB]arg2\f[R], and \f[CB]arg3\f[R] arguments are passed The \f[V]arg1\f[R], \f[V]arg2\f[R], and \f[V]arg3\f[R] arguments are
to the script. passed to the script.
The script can access these arguments with an arguments array. The script can access these arguments with an arguments array.
.RS .RS
.PP .PP
\f[CB]jrunscript\ test.js\ arg1\ arg2\ arg3\f[R] \f[V]jrunscript test.js arg1 arg2 arg3\f[R]
.RE .RE

File diff suppressed because it is too large Load diff

View file

@ -19,66 +19,72 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "SERIALVER" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "SERIALVER" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
serialver \- return the \f[CB]serialVersionUID\f[R] for one or more serialver - return the \f[V]serialVersionUID\f[R] for one or more
classes in a form suitable for copying into an evolving class classes in a form suitable for copying into an evolving class
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]serialver\f[R] [\f[I]options\f[R]] [\f[I]classnames\f[R]] \f[V]serialver\f[R] [\f[I]options\f[R]] [\f[I]classnames\f[R]]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
This represents the command\-line options for the \f[CB]serialver\f[R] This represents the command-line options for the \f[V]serialver\f[R]
command. command.
See \f[B]Options for serialver\f[R]. See \f[B]Options for serialver\f[R].
.RS
.RE
.TP .TP
.B \f[I]classnames\f[R] \f[I]classnames\f[R]
The classes for which \f[CB]serialVersionUID\f[R] is to be returned. The classes for which \f[V]serialVersionUID\f[R] is to be returned.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]serialver\f[R] command returns the \f[CB]serialVersionUID\f[R] for The \f[V]serialver\f[R] command returns the \f[V]serialVersionUID\f[R]
one or more classes in a form suitable for copying into an evolving for one or more classes in a form suitable for copying into an evolving
class. class.
When called with no arguments, the \f[CB]serialver\f[R] command prints a When called with no arguments, the \f[V]serialver\f[R] command prints a
usage line. usage line.
.SH OPTIONS FOR SERIALVER .SH OPTIONS FOR SERIALVER
.TP .TP
.B \f[CB]\-classpath\f[R] \f[I]path\-files\f[R] \f[V]-classpath\f[R] \f[I]path-files\f[R]
Sets the search path for application classes and resources. Sets the search path for application classes and resources.
Separate classes and resources with a colon (:). Separate classes and resources with a colon (:).
.RS
.RE
.TP .TP
.B \f[CB]\-J\f[R]\f[I]option\f[R] \f[V]-J\f[R]\f[I]option\f[R]
Passes the specified \f[I]option\f[R] to the Java Virtual Machine, where Passes the specified \f[I]option\f[R] to the Java Virtual Machine, where
\f[I]option\f[R] is one of the options described on the reference page \f[I]option\f[R] is one of the options described on the reference page
for the Java application launcher. for the Java application launcher.
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB. For example, \f[V]-J-Xms48m\f[R] sets the startup memory to 48 MB.
.RS
.RE
.SH NOTES .SH NOTES
.PP .PP
The \f[CB]serialver\f[R] command loads and initializes the specified The \f[V]serialver\f[R] command loads and initializes the specified
classes in its virtual machine, and by default, it doesn\[aq]t set a classes in its virtual machine, and by default, it doesn\[aq]t set a
security manager. security manager.
If the \f[CB]serialver\f[R] command is to be run with untrusted classes, If the \f[V]serialver\f[R] command is to be run with untrusted classes,
then a security manager can be set with the following option: then a security manager can be set with the following option:
.RS .RS
.PP .PP
\f[CB]\-J\-Djava.security.manager\f[R] \f[V]-J-Djava.security.manager\f[R]
.RE .RE
.PP .PP
When necessary, a security policy can be specified with the following When necessary, a security policy can be specified with the following
option: option:
.RS .RS
.PP .PP
\f[CB]\-J\-Djava.security.policy=\f[R]\f[I]policy_file\f[R] \f[V]-J-Djava.security.policy=\f[R]\f[I]policy_file\f[R]
.RE .RE

View file

@ -19,242 +19,196 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JHSDB" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JHSDB" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jhsdb \- attach to a Java process or launch a postmortem debugger to jhsdb - attach to a Java process or launch a postmortem debugger to
analyze the content of a core dump from a crashed Java Virtual Machine analyze the content of a core dump from a crashed Java Virtual Machine
(JVM) (JVM)
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jhsdb\f[R] \f[CB]clhsdb\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[V]jhsdb\f[R] \f[V]clhsdb\f[R] [\f[V]--pid\f[R] \f[I]pid\f[R] |
\f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[V]--exe\f[R] \f[I]executable\f[R] \f[V]--core\f[R]
\f[I]coredump\f[R]] \f[I]coredump\f[R]]
.PP .PP
\f[CB]jhsdb\f[R] \f[CB]hsdb\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[V]jhsdb\f[R] \f[V]hsdb\f[R] [\f[V]--pid\f[R] \f[I]pid\f[R] |
\f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[V]--exe\f[R] \f[I]executable\f[R] \f[V]--core\f[R]
\f[I]coredump\f[R]] \f[I]coredump\f[R]]
.PP .PP
\f[CB]jhsdb\f[R] \f[CB]debugd\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[V]jhsdb\f[R] \f[V]debugd\f[R] (\f[V]--pid\f[R] \f[I]pid\f[R] |
\f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[V]--exe\f[R] \f[I]executable\f[R] \f[V]--core\f[R]
\f[I]coredump\f[R]) [\f[I]options\f[R]] \f[I]coredump\f[R]) [\f[I]options\f[R]]
.PP .PP
\f[CB]jhsdb\f[R] \f[CB]jstack\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[V]jhsdb\f[R] \f[V]jstack\f[R] (\f[V]--pid\f[R] \f[I]pid\f[R] |
\f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R] \f[V]--exe\f[R] \f[I]executable\f[R] \f[V]--core\f[R] \f[I]coredump\f[R]
| \f[CB]\-\-connect\f[R] \f[I][server\-id\@]debugd\-host\f[R]) | \f[V]--connect\f[R] \f[I][server-id\[at]]debugd-host\f[R])
[\f[I]options\f[R]] [\f[I]options\f[R]]
.PP .PP
\f[CB]jhsdb\f[R] \f[CB]jmap\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[V]jhsdb\f[R] \f[V]jmap\f[R] (\f[V]--pid\f[R] \f[I]pid\f[R] |
\f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R] \f[V]--exe\f[R] \f[I]executable\f[R] \f[V]--core\f[R] \f[I]coredump\f[R]
| \f[CB]\-\-connect\f[R] \f[I][server\-id\@]debugd\-host\f[R]) | \f[V]--connect\f[R] \f[I][server-id\[at]]debugd-host\f[R])
[\f[I]options\f[R]] [\f[I]options\f[R]]
.PP .PP
\f[CB]jhsdb\f[R] \f[CB]jinfo\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[V]jhsdb\f[R] \f[V]jinfo\f[R] (\f[V]--pid\f[R] \f[I]pid\f[R] |
\f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R] \f[V]--exe\f[R] \f[I]executable\f[R] \f[V]--core\f[R] \f[I]coredump\f[R]
| \f[CB]\-\-connect\f[R] \f[I][server\-id\@]debugd\-host\f[R]) | \f[V]--connect\f[R] \f[I][server-id\[at]]debugd-host\f[R])
[\f[I]options\f[R]] [\f[I]options\f[R]]
.PP .PP
\f[CB]jhsdb\f[R] \f[CB]jsnap\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[V]jhsdb\f[R] \f[V]jsnap\f[R] (\f[V]--pid\f[R] \f[I]pid\f[R] |
\f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R] \f[V]--exe\f[R] \f[I]executable\f[R] \f[V]--core\f[R] \f[I]coredump\f[R]
| \f[CB]\-\-connect\f[R] \f[I][server\-id\@]debugd\-host\f[R]) | \f[V]--connect\f[R] \f[I][server-id\[at]]debugd-host\f[R])
[\f[I]options\f[R]] [\f[I]options\f[R]]
.TP .TP
.B \f[I]pid\f[R] \f[I]pid\f[R]
The process ID to which the \f[CB]jhsdb\f[R] tool should attach. The process ID to which the \f[V]jhsdb\f[R] tool should attach.
The process must be a Java process. The process must be a Java process.
To get a list of Java processes running on a machine, use the To get a list of Java processes running on a machine, use the
\f[CB]ps\f[R] command or, if the JVM processes are not running in a \f[V]ps\f[R] command or, if the JVM processes are not running in a
separate docker instance, the \f[B]jps\f[R] command. separate docker instance, the \f[B]jps\f[R] command.
.RS
.RE
.TP .TP
.B \f[I]executable\f[R] \f[I]executable\f[R]
The Java executable file from which the core dump was produced. The Java executable file from which the core dump was produced.
.RS
.RE
.TP .TP
.B \f[I]coredump\f[R] \f[I]coredump\f[R]
The core file to which the \f[CB]jhsdb\f[R] tool should attach. The core file to which the \f[V]jhsdb\f[R] tool should attach.
.RS
.RE
.TP .TP
.B \f[I][server\-id\@]debugd\-host\f[R] \f[I][server-id\[at]]debugd-host\f[R]
An optional server ID and the address of the remote debug server An optional server ID and the address of the remote debug server
(debugd). (debugd).
.RS
.RE
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
The command\-line options for a \f[CB]jhsdb\f[R] mode. The command-line options for a \f[V]jhsdb\f[R] mode.
See \f[B]Options for the debugd Mode\f[R], \f[B]Options for the jstack See \f[B]Options for the debugd Mode\f[R], \f[B]Options for the jstack
Mode\f[R], \f[B]Options for the jmap Mode\f[R], \f[B]Options for the jinfo Mode\f[R], \f[B]Options for the jmap Mode\f[R], \f[B]Options for the
Mode\f[R], and \f[B]Options for the jsnap Mode\f[R]. jinfo Mode\f[R], and \f[B]Options for the jsnap Mode\f[R].
.RS
.RE
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
Either the \f[I]pid\f[R] or the pair of \f[I]executable\f[R] and Either the \f[I]pid\f[R] or the pair of \f[I]executable\f[R] and
\f[I]core\f[R] files or the \f[I][server\-id\@]debugd\-host\f[R] must be \f[I]core\f[R] files or the \f[I][server-id\[at]]debugd-host\f[R] must
provided for \f[CB]debugd\f[R], \f[CB]jstack\f[R], \f[CB]jmap\f[R], be provided for \f[V]debugd\f[R], \f[V]jstack\f[R], \f[V]jmap\f[R],
\f[CB]jinfo\f[R] and \f[CB]jsnap\f[R] modes. \f[V]jinfo\f[R] and \f[V]jsnap\f[R] modes.
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
You can use the \f[CB]jhsdb\f[R] tool to attach to a Java process or to You can use the \f[V]jhsdb\f[R] tool to attach to a Java process or to
launch a postmortem debugger to analyze the content of a core\-dump from launch a postmortem debugger to analyze the content of a core-dump from
a crashed Java Virtual Machine (JVM). a crashed Java Virtual Machine (JVM).
This command is experimental and unsupported. This command is experimental and unsupported.
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
Attaching the \f[CB]jhsdb\f[R] tool to a live process will cause the Attaching the \f[V]jhsdb\f[R] tool to a live process will cause the
process to hang and the process will probably crash when the debugger process to hang and the process will probably crash when the debugger
detaches. detaches.
.PP .PP
The \f[CB]jhsdb\f[R] tool can be launched in any one of the following The \f[V]jhsdb\f[R] tool can be launched in any one of the following
modes: modes:
.TP .TP
.B \f[CB]jhsdb\ clhsdb\f[R] \f[V]jhsdb clhsdb\f[R]
Starts the interactive command\-line debugger. Starts the interactive command-line debugger.
.RS
.RE
.TP .TP
.B \f[CB]jhsdb\ hsdb\f[R] \f[V]jhsdb hsdb\f[R]
Starts the interactive GUI debugger. Starts the interactive GUI debugger.
.RS
.RE
.TP .TP
.B \f[CB]jhsdb\ debugd\f[R] \f[V]jhsdb debugd\f[R]
Starts the remote debug server. Starts the remote debug server.
.RS
.RE
.TP .TP
.B \f[CB]jhsdb\ jstack\f[R] \f[V]jhsdb jstack\f[R]
Prints stack and locks information. Prints stack and locks information.
.RS
.RE
.TP .TP
.B \f[CB]jhsdb\ jmap\f[R] \f[V]jhsdb jmap\f[R]
Prints heap information. Prints heap information.
.RS
.RE
.TP .TP
.B \f[CB]jhsdb\ jinfo\f[R] \f[V]jhsdb jinfo\f[R]
Prints basic JVM information. Prints basic JVM information.
.RS
.RE
.TP .TP
.B \f[CB]jhsdb\ jsnap\f[R] \f[V]jhsdb jsnap\f[R]
Prints performance counter information. Prints performance counter information.
.RS
.RE
.TP .TP
.B \f[CB]jhsdb\f[R] \f[I]command\f[R] \f[CB]\-\-help\f[R] \f[V]jhsdb\f[R] \f[I]command\f[R] \f[V]--help\f[R]
Displays the options available for the \f[I]command\f[R]. Displays the options available for the \f[I]command\f[R].
.RS
.RE
.SH OPTIONS FOR THE DEBUGD MODE .SH OPTIONS FOR THE DEBUGD MODE
.TP .TP
.B \f[CB]\-\-serverid\f[R] \f[I]server\-id\f[R] \f[V]--serverid\f[R] \f[I]server-id\f[R]
An optional unique ID for this debug server. An optional unique ID for this debug server.
This is required if multiple debug servers are run on the same machine. This is required if multiple debug servers are run on the same machine.
.RS
.RE
.TP .TP
.B \f[CB]\-\-rmiport\f[R] \f[I]port\f[R] \f[V]--rmiport\f[R] \f[I]port\f[R]
Sets the port number to which the RMI connector is bound. Sets the port number to which the RMI connector is bound.
If not specified a random available port is used. If not specified a random available port is used.
.RS
.RE
.TP .TP
.B \f[CB]\-\-registryport\f[R] \f[I]port\f[R] \f[V]--registryport\f[R] \f[I]port\f[R]
Sets the RMI registry port. Sets the RMI registry port.
This option overrides the system property This option overrides the system property
\[aq]sun.jvm.hotspot.rmi.port\[aq]. \[aq]sun.jvm.hotspot.rmi.port\[aq].
If not specified, the system property is used. If not specified, the system property is used.
If the system property is not set, the default port 1099 is used. If the system property is not set, the default port 1099 is used.
.RS
.RE
.TP .TP
.B \f[CB]\-\-hostname\f[R] \f[I]hostname\f[R] \f[V]--hostname\f[R] \f[I]hostname\f[R]
Sets the hostname the RMI connector is bound. Sets the hostname the RMI connector is bound.
The value could be a hostname or an IPv4/IPv6 address. The value could be a hostname or an IPv4/IPv6 address.
This option overrides the system property This option overrides the system property
\[aq]java.rmi.server.hostname\[aq]. \[aq]java.rmi.server.hostname\[aq].
If not specified, the system property is used. If not specified, the system property is used.
If the system property is not set, a system hostname is used. If the system property is not set, a system hostname is used.
.RS
.RE
.SH OPTIONS FOR THE JINFO MODE .SH OPTIONS FOR THE JINFO MODE
.TP .TP
.B \f[CB]\-\-flags\f[R] \f[V]--flags\f[R]
Prints the VM flags. Prints the VM flags.
.RS
.RE
.TP .TP
.B \f[CB]\-\-sysprops\f[R] \f[V]--sysprops\f[R]
Prints the Java system properties. Prints the Java system properties.
.RS
.RE
.TP .TP
.B no option no option
Prints the VM flags and the Java system properties. Prints the VM flags and the Java system properties.
.RS
.RE
.SH OPTIONS FOR THE JMAP MODE .SH OPTIONS FOR THE JMAP MODE
.TP .TP
.B no option no option
Prints the same information as Solaris \f[CB]pmap\f[R]. Prints the same information as Solaris \f[V]pmap\f[R].
.RS
.RE
.TP .TP
.B \f[CB]\-\-heap\f[R] \f[V]--heap\f[R]
Prints the \f[CB]java\f[R] heap summary. Prints the \f[V]java\f[R] heap summary.
.RS
.RE
.TP .TP
.B \f[CB]\-\-binaryheap\f[R] \f[V]--binaryheap\f[R]
Dumps the \f[CB]java\f[R] heap in \f[CB]hprof\f[R] binary format. Dumps the \f[V]java\f[R] heap in \f[V]hprof\f[R] binary format.
.RS
.RE
.TP .TP
.B \f[CB]\-\-dumpfile\f[R] \f[I]name\f[R] \f[V]--dumpfile\f[R] \f[I]name\f[R]
The name of the dumpfile. The name of the dumpfile.
.RS
.RE
.TP .TP
.B \f[CB]\-\-histo\f[R] \f[V]--histo\f[R]
Prints the histogram of \f[CB]java\f[R] object heap. Prints the histogram of \f[V]java\f[R] object heap.
.RS
.RE
.TP .TP
.B \f[CB]\-\-clstats\f[R] \f[V]--clstats\f[R]
Prints the class loader statistics. Prints the class loader statistics.
.RS
.RE
.TP .TP
.B \f[CB]\-\-finalizerinfo\f[R] \f[V]--finalizerinfo\f[R]
Prints the information on objects awaiting finalization. Prints the information on objects awaiting finalization.
.RS
.RE
.SH OPTIONS FOR THE JSTACK MODE .SH OPTIONS FOR THE JSTACK MODE
.TP .TP
.B \f[CB]\-\-locks\f[R] \f[V]--locks\f[R]
Prints the \f[CB]java.util.concurrent\f[R] locks information. Prints the \f[V]java.util.concurrent\f[R] locks information.
.RS
.RE
.TP .TP
.B \f[CB]\-\-mixed\f[R] \f[V]--mixed\f[R]
Attempts to print both \f[CB]java\f[R] and native frames if the platform Attempts to print both \f[V]java\f[R] and native frames if the platform
allows it. allows it.
.RS
.RE
.SH OPTIONS FOR THE JSNAP MODE .SH OPTIONS FOR THE JSNAP MODE
.TP .TP
.B \f[CB]\-\-all\f[R] \f[V]--all\f[R]
Prints all performance counters. Prints all performance counters.
.RS
.RE

View file

@ -19,32 +19,44 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JWEBSERVER" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JWEBSERVER" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jwebserver \- launch the Java Simple Web Server jwebserver - launch the Java Simple Web Server
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jwebserver\f[R] [\f[I]options\f[R]] \f[V]jwebserver\f[R] [\f[I]options\f[R]]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
Command\-line options. Command-line options.
For a detailed description of the options, see \f[B]Options\f[R]. For a detailed description of the options, see \f[B]Options\f[R].
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jwebserver\f[R] tool provides a minimal HTTP server, designed to The \f[V]jwebserver\f[R] tool provides a minimal HTTP server, designed
be used for prototyping, testing, and debugging. to be used for prototyping, testing, and debugging.
It serves a single directory hierarchy, and only serves static files. It serves a single directory hierarchy, and only serves static files.
Only HTTP/1.1 is supported; HTTP/2 and HTTPS are not supported. Only HTTP/1.1 is supported; HTTP/2 and HTTPS are not supported.
.PP .PP
Only idempotent HEAD and GET requests are served. Only idempotent HEAD and GET requests are served.
Any other requests receive a \f[CB]501\ \-\ Not\ Implemented\f[R] or a Any other requests receive a \f[V]501 - Not Implemented\f[R] or a
\f[CB]405\ \-\ Not\ Allowed\f[R] response. \f[V]405 - Not Allowed\f[R] response.
GET requests are mapped to the directory being served, as follows: GET requests are mapped to the directory being served, as follows:
.IP \[bu] 2 .IP \[bu] 2
If the requested resource is a file, its content is served. If the requested resource is a file, its content is served.
@ -56,103 +68,88 @@ Otherwise, the names of all files and subdirectories of the directory
are listed. are listed.
Symbolic links and hidden files are not listed or served. Symbolic links and hidden files are not listed or served.
.PP .PP
MIME types are configured automatically, using the built\-in table. MIME types are configured automatically, using the built-in table.
For example, \f[CB]\&.html\f[R] files are served as \f[CB]text/html\f[R] and For example, \f[V].html\f[R] files are served as \f[V]text/html\f[R] and
\f[CB]\&.java\f[R] files are served as \f[CB]text/plain\f[R]. \f[V].java\f[R] files are served as \f[V]text/plain\f[R].
.PP .PP
\f[CB]jwebserver\f[R] is located in the jdk.httpserver module, and can \f[V]jwebserver\f[R] is located in the jdk.httpserver module, and can
alternatively be started with \f[CB]java\ \-m\ jdk.httpserver\f[R]. alternatively be started with \f[V]java -m jdk.httpserver\f[R].
It is based on the web server implementation in the It is based on the web server implementation in the
\f[CB]com.sun.net.httpserver\f[R] package. \f[V]com.sun.net.httpserver\f[R] package.
The \f[CB]com.sun.net.httpserver.SimpleFileServer\f[R] class provides a The \f[V]com.sun.net.httpserver.SimpleFileServer\f[R] class provides a
programmatic way to retrieve the server and its components for reuse and programmatic way to retrieve the server and its components for reuse and
extension. extension.
.SH USAGE .SH USAGE
.IP .IP
.nf .nf
\f[CB] \f[CB]
jwebserver\ [\-b\ bind\ address]\ [\-p\ port]\ [\-d\ directory] jwebserver [-b bind address] [-p port] [-d directory]
\ \ \ \ \ \ \ \ \ \ \ [\-o\ none|info|verbose]\ [\-h\ to\ show\ options] [-o none|info|verbose] [-h to show options]
\ \ \ \ \ \ \ \ \ \ \ [\-version\ to\ show\ version\ information] [-version to show version information]
\f[R] \f[R]
.fi .fi
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \f[CB]\-h\f[R] or \f[CB]\-?\f[R] or \f[CB]\-\-help\f[R] \f[V]-h\f[R] or \f[V]-?\f[R] or \f[V]--help\f[R]
Prints the help message and exits. Prints the help message and exits.
.RS
.RE
.TP .TP
.B \f[CB]\-b\f[R] \f[I]addr\f[R] or \f[CB]\-\-bind\-address\f[R] \f[I]addr\f[R] \f[V]-b\f[R] \f[I]addr\f[R] or \f[V]--bind-address\f[R] \f[I]addr\f[R]
Specifies the address to bind to. Specifies the address to bind to.
Default: 127.0.0.1 or ::1 (loopback). Default: 127.0.0.1 or ::1 (loopback).
For all interfaces use \f[CB]\-b\ 0.0.0.0\f[R] or \f[CB]\-b\ ::\f[R]. For all interfaces use \f[V]-b 0.0.0.0\f[R] or \f[V]-b ::\f[R].
.RS
.RE
.TP .TP
.B \f[CB]\-d\f[R] \f[I]dir\f[R] or \f[CB]\-\-directory\f[R] \f[I]dir\f[R] \f[V]-d\f[R] \f[I]dir\f[R] or \f[V]--directory\f[R] \f[I]dir\f[R]
Specifies the directory to serve. Specifies the directory to serve.
Default: current directory. Default: current directory.
.RS
.RE
.TP .TP
.B \f[CB]\-o\f[R] \f[I]level\f[R] or \f[CB]\-\-output\f[R] \f[I]level\f[R] \f[V]-o\f[R] \f[I]level\f[R] or \f[V]--output\f[R] \f[I]level\f[R]
Specifies the output format. Specifies the output format.
\f[CB]none\f[R] | \f[CB]info\f[R] | \f[CB]verbose\f[R]. \f[V]none\f[R] | \f[V]info\f[R] | \f[V]verbose\f[R].
Default: \f[CB]info\f[R]. Default: \f[V]info\f[R].
.RS
.RE
.TP .TP
.B \f[CB]\-p\f[R] \f[I]port\f[R] or \f[CB]\-\-port\f[R] \f[I]port\f[R] \f[V]-p\f[R] \f[I]port\f[R] or \f[V]--port\f[R] \f[I]port\f[R]
Specifies the port to listen on. Specifies the port to listen on.
Default: 8000. Default: 8000.
.RS
.RE
.TP .TP
.B \f[CB]\-version\f[R] or \f[CB]\-\-version\f[R] \f[V]-version\f[R] or \f[V]--version\f[R]
Prints the version information and exits. Prints the version information and exits.
.RS
.RE
.PP .PP
To stop the server, press \f[CB]Ctrl\ +\ C\f[R]. To stop the server, press \f[V]Ctrl + C\f[R].
.SH STARTING THE SERVER .SH STARTING THE SERVER
.PP .PP
The following command starts the Simple Web Server: The following command starts the Simple Web Server:
.IP .IP
.nf .nf
\f[CB] \f[CB]
$\ jwebserver $ jwebserver
\f[R] \f[R]
.fi .fi
.PP .PP
If startup is successful, the server prints a message to If startup is successful, the server prints a message to
\f[CB]System.out\f[R] listing the local address and the absolute path of \f[V]System.out\f[R] listing the local address and the absolute path of
the directory being served. the directory being served.
For example: For example:
.IP .IP
.nf .nf
\f[CB] \f[CB]
$\ jwebserver $ jwebserver
Binding\ to\ loopback\ by\ default.\ For\ all\ interfaces\ use\ "\-b\ 0.0.0.0"\ or\ "\-b\ ::". Binding to loopback by default. For all interfaces use \[dq]-b 0.0.0.0\[dq] or \[dq]-b ::\[dq].
Serving\ /cwd\ and\ subdirectories\ on\ 127.0.0.1\ port\ 8000 Serving /cwd and subdirectories on 127.0.0.1 port 8000
URL\ http://127.0.0.1:8000/ URL http://127.0.0.1:8000/
\f[R] \f[R]
.fi .fi
.SH CONFIGURATION .SH CONFIGURATION
.PP .PP
By default, the server runs in the foreground and binds to the loopback By default, the server runs in the foreground and binds to the loopback
address and port 8000. address and port 8000.
This can be changed with the \f[CB]\-b\f[R] and \f[CB]\-p\f[R] options. This can be changed with the \f[V]-b\f[R] and \f[V]-p\f[R] options.
.PD 0
.P
.PD
For example, to bind the Simple Web Server to all interfaces, use: For example, to bind the Simple Web Server to all interfaces, use:
.IP .IP
.nf .nf
\f[CB] \f[CB]
$\ jwebserver\ \-b\ 0.0.0.0 $ jwebserver -b 0.0.0.0
Serving\ /cwd\ and\ subdirectories\ on\ 0.0.0.0\ (all\ interfaces)\ port\ 8000 Serving /cwd and subdirectories on 0.0.0.0 (all interfaces) port 8000
URL\ http://123.456.7.891:8000/ URL http://123.456.7.891:8000/
\f[R] \f[R]
.fi .fi
.PP .PP
@ -165,32 +162,32 @@ As another example, use the following command to run on port 9000:
.IP .IP
.nf .nf
\f[CB] \f[CB]
$\ jwebserver\ \-p\ 9000 $ jwebserver -p 9000
\f[R] \f[R]
.fi .fi
.PP .PP
By default, the files of the current directory are served. By default, the files of the current directory are served.
A different directory can be specified with the \f[CB]\-d\f[R] option. A different directory can be specified with the \f[V]-d\f[R] option.
.PP .PP
By default, every request is logged on the console. By default, every request is logged on the console.
The output looks like this: The output looks like this:
.IP .IP
.nf .nf
\f[CB] \f[CB]
127.0.0.1\ \-\ \-\ [10/Feb/2021:14:34:11\ +0000]\ "GET\ /some/subdirectory/\ HTTP/1.1"\ 200\ \- 127.0.0.1 - - [10/Feb/2021:14:34:11 +0000] \[dq]GET /some/subdirectory/ HTTP/1.1\[dq] 200 -
\f[R] \f[R]
.fi .fi
.PP .PP
Logging output can be changed with the \f[CB]\-o\f[R] option. Logging output can be changed with the \f[V]-o\f[R] option.
The default setting is \f[CB]info\f[R]. The default setting is \f[V]info\f[R].
The \f[CB]verbose\f[R] setting additionally includes the request and The \f[V]verbose\f[R] setting additionally includes the request and
response headers as well as the absolute path of the requested resource. response headers as well as the absolute path of the requested resource.
.SH STOPPING THE SERVER .SH STOPPING THE SERVER
.PP .PP
Once started successfully, the server runs until it is stopped. Once started successfully, the server runs until it is stopped.
On Unix platforms, the server can be stopped by sending it a On Unix platforms, the server can be stopped by sending it a
\f[CB]SIGINT\f[R] signal (\f[CB]Ctrl+C\f[R] in a terminal window). \f[V]SIGINT\f[R] signal (\f[V]Ctrl+C\f[R] in a terminal window).
.SH HELP OPTION .SH HELP OPTION
.PP .PP
The \f[CB]\-h\f[R] option displays a help message describing the usage and The \f[V]-h\f[R] option displays a help message describing the usage and
the options of the \f[CB]jwebserver\f[R]. the options of the \f[V]jwebserver\f[R].

View file

@ -19,30 +19,46 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JAR" "1" "2022" "JDK 20\-internal" "JDK Commands" .\" 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 "JAR" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jar \- create an archive for classes and resources, and manipulate or jar - create an archive for classes and resources, and manipulate or
restore individual classes or resources from an archive restore individual classes or resources from an archive
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jar\f[R] [\f[I]OPTION\f[R] ...] [ [\f[CB]\-\-release\f[R] \f[V]jar\f[R] [\f[I]OPTION\f[R] ...]
\f[I]VERSION\f[R]] [\f[CB]\-C\f[R] \f[I]dir\f[R]] \f[I]files\f[R]] ... [ [\f[V]--release\f[R] \f[I]VERSION\f[R]] [\f[V]-C\f[R] \f[I]dir\f[R]]
\f[I]files\f[R]] ...
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jar\f[R] command is a general\-purpose archiving and compression The \f[V]jar\f[R] command is a general-purpose archiving and compression
tool, based on the ZIP and ZLIB compression formats. tool, based on the ZIP and ZLIB compression formats.
Initially, the \f[CB]jar\f[R] command was designed to package Java applets Initially, the \f[V]jar\f[R] command was designed to package Java
(not supported since JDK 11) or applications; however, beginning with applets (not supported since JDK 11) or applications; however, beginning
JDK 9, users can use the \f[CB]jar\f[R] command to create modular JARs. with JDK 9, users can use the \f[V]jar\f[R] command to create modular
JARs.
For transportation and deployment, it\[aq]s usually more convenient to For transportation and deployment, it\[aq]s usually more convenient to
package modules as modular JARs. package modules as modular JARs.
.PP .PP
The syntax for the \f[CB]jar\f[R] command resembles the syntax for the The syntax for the \f[V]jar\f[R] command resembles the syntax for the
\f[CB]tar\f[R] command. \f[V]tar\f[R] command.
It has several main operation modes, defined by one of the mandatory It has several main operation modes, defined by one of the mandatory
operation arguments. operation arguments.
Other arguments are either options that modify the behavior of the Other arguments are either options that modify the behavior of the
@ -53,25 +69,25 @@ sounds) are combined into a single archive, they can be downloaded by a
Java agent (such as a browser) in a single HTTP transaction, rather than Java agent (such as a browser) in a single HTTP transaction, rather than
requiring a new connection for each piece. requiring a new connection for each piece.
This dramatically improves download times. This dramatically improves download times.
The \f[CB]jar\f[R] command also compresses files, which further improves The \f[V]jar\f[R] command also compresses files, which further improves
download time. download time.
The \f[CB]jar\f[R] command also enables individual entries in a file to be The \f[V]jar\f[R] command also enables individual entries in a file to
signed so that their origin can be authenticated. be signed so that their origin can be authenticated.
A JAR file can be used as a class path entry, whether or not it\[aq]s A JAR file can be used as a class path entry, whether or not it\[aq]s
compressed. compressed.
.PP .PP
An archive becomes a modular JAR when you include a module descriptor, An archive becomes a modular JAR when you include a module descriptor,
\f[CB]module\-info.class\f[R], in the root of the given directories or in \f[V]module-info.class\f[R], in the root of the given directories or in
the root of the \f[CB]\&.jar\f[R] archive. the root of the \f[V].jar\f[R] archive.
The following operations described in \f[B]Operation Modifiers Valid The following operations described in \f[B]Operation Modifiers Valid
Only in Create and Update Modes\f[R] are valid only when creating or Only in Create and Update Modes\f[R] are valid only when creating or
updating a modular jar or updating an existing non\-modular jar: updating a modular jar or updating an existing non-modular jar:
.IP \[bu] 2 .IP \[bu] 2
\f[CB]\-\-module\-version\f[R] \f[V]--module-version\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]\-\-hash\-modules\f[R] \f[V]--hash-modules\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]\-\-module\-path\f[R] \f[V]--module-path\f[R]
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
@ -79,285 +95,245 @@ All mandatory or optional arguments for long options are also mandatory
or optional for any corresponding short options. or optional for any corresponding short options.
.SH MAIN OPERATION MODES .SH MAIN OPERATION MODES
.PP .PP
When using the \f[CB]jar\f[R] command, you must specify the operation for When using the \f[V]jar\f[R] command, you must specify the operation for
it to perform. it to perform.
You specify the operation mode for the \f[CB]jar\f[R] command by including You specify the operation mode for the \f[V]jar\f[R] command by
the appropriate operation arguments described in this section. including the appropriate operation arguments described in this section.
You can mix an operation argument with other one\-letter options. You can mix an operation argument with other one-letter options.
Generally the operation argument is the first argument specified on the Generally the operation argument is the first argument specified on the
command line. command line.
.TP .TP
.B \f[CB]\-c\f[R] or \f[CB]\-\-create\f[R] \f[V]-c\f[R] or \f[V]--create\f[R]
Creates the archive. Creates the archive.
.RS
.RE
.TP .TP
.B \f[CB]\-i\f[R] \f[I]FILE\f[R] or \f[CB]\-\-generate\-index=\f[R]\f[I]FILE\f[R] \f[V]-i\f[R] \f[I]FILE\f[R] or \f[V]--generate-index=\f[R]\f[I]FILE\f[R]
Generates index information for the specified JAR file. Generates index information for the specified JAR file.
.RS
.RE
.TP .TP
.B \f[CB]\-t\f[R] or \f[CB]\-\-list\f[R] \f[V]-t\f[R] or \f[V]--list\f[R]
Lists the table of contents for the archive. Lists the table of contents for the archive.
.RS
.RE
.TP .TP
.B \f[CB]\-u\f[R] or \f[CB]\-\-update\f[R] \f[V]-u\f[R] or \f[V]--update\f[R]
Updates an existing JAR file. Updates an existing JAR file.
.RS
.RE
.TP .TP
.B \f[CB]\-x\f[R] or \f[CB]\-\-extract\f[R] \f[V]-x\f[R] or \f[V]--extract\f[R]
Extracts the named (or all) files from the archive. Extracts the named (or all) files from the archive.
.RS
.RE
.TP .TP
.B \f[CB]\-d\f[R] or \f[CB]\-\-describe\-module\f[R] \f[V]-d\f[R] or \f[V]--describe-module\f[R]
Prints the module descriptor or automatic module name. Prints the module descriptor or automatic module name.
.RS
.RE
.SH OPERATION MODIFIERS VALID IN ANY MODE .SH OPERATION MODIFIERS VALID IN ANY MODE
.PP .PP
You can use the following options to customize the actions of any You can use the following options to customize the actions of any
operation mode included in the \f[CB]jar\f[R] command. operation mode included in the \f[V]jar\f[R] command.
.TP .TP
.B \f[CB]\-C\f[R] \f[I]DIR\f[R] \f[V]-C\f[R] \f[I]DIR\f[R]
Changes the specified directory and includes the \f[I]files\f[R] Changes the specified directory and includes the \f[I]files\f[R]
specified at the end of the command line. specified at the end of the command line.
.RS .RS
.PP .PP
\f[CB]jar\f[R] [\f[I]OPTION\f[R] ...] [ [\f[CB]\-\-release\f[R] \f[V]jar\f[R] [\f[I]OPTION\f[R] ...]
\f[I]VERSION\f[R]] [\f[CB]\-C\f[R] \f[I]dir\f[R]] \f[I]files\f[R]] [ [\f[V]--release\f[R] \f[I]VERSION\f[R]] [\f[V]-C\f[R] \f[I]dir\f[R]]
\f[I]files\f[R]]
.RE .RE
.TP .TP
.B \f[CB]\-f\f[R] \f[I]FILE\f[R] or \f[CB]\-\-file=\f[R]\f[I]FILE\f[R] \f[V]-f\f[R] \f[I]FILE\f[R] or \f[V]--file=\f[R]\f[I]FILE\f[R]
Specifies the archive file name. Specifies the archive file name.
.RS
.RE
.TP .TP
.B \f[CB]\-\-release\f[R] \f[I]VERSION\f[R] \f[V]--release\f[R] \f[I]VERSION\f[R]
Creates a multirelease JAR file. Creates a multirelease JAR file.
Places all files specified after the option into a versioned directory Places all files specified after the option into a versioned directory
of the JAR file named of the JAR file named
\f[CB]META\-INF/versions/\f[R]\f[I]VERSION\f[R]\f[CB]/\f[R], where \f[V]META-INF/versions/\f[R]\f[I]VERSION\f[R]\f[V]/\f[R], where
\f[I]VERSION\f[R] must be must be a positive integer whose value is 9 or \f[I]VERSION\f[R] must be must be a positive integer whose value is 9 or
greater. greater.
.RS .RS
.PP .PP
At run time, where more than one version of a class exists in the JAR, At run time, where more than one version of a class exists in the JAR,
the JDK will use the first one it finds, searching initially in the the JDK will use the first one it finds, searching initially in the
directory tree whose \f[I]VERSION\f[R] number matches the JDK\[aq]s major directory tree whose \f[I]VERSION\f[R] number matches the JDK\[aq]s
version number. major version number.
It will then look in directories with successively lower It will then look in directories with successively lower
\f[I]VERSION\f[R] numbers, and finally look in the root of the JAR. \f[I]VERSION\f[R] numbers, and finally look in the root of the JAR.
.RE .RE
.TP .TP
.B \f[CB]\-v\f[R] or \f[CB]\-\-verbose\f[R] \f[V]-v\f[R] or \f[V]--verbose\f[R]
Sends or prints verbose output to standard output. Sends or prints verbose output to standard output.
.RS
.RE
.SH OPERATION MODIFIERS VALID ONLY IN CREATE AND UPDATE MODES .SH OPERATION MODIFIERS VALID ONLY IN CREATE AND UPDATE MODES
.PP .PP
You can use the following options to customize the actions of the create You can use the following options to customize the actions of the create
and the update main operation modes: and the update main operation modes:
.TP .TP
.B \f[CB]\-e\f[R] \f[I]CLASSNAME\f[R] or \f[CB]\-\-main\-class=\f[R]\f[I]CLASSNAME\f[R] \f[V]-e\f[R] \f[I]CLASSNAME\f[R] or \f[V]--main-class=\f[R]\f[I]CLASSNAME\f[R]
Specifies the application entry point for standalone applications Specifies the application entry point for standalone applications
bundled into a modular or executable modular JAR file. bundled into a modular or executable modular JAR file.
.RS
.RE
.TP .TP
.B \f[CB]\-m\f[R] \f[I]FILE\f[R] or \f[CB]\-\-manifest=\f[R]\f[I]FILE\f[R] \f[V]-m\f[R] \f[I]FILE\f[R] or \f[V]--manifest=\f[R]\f[I]FILE\f[R]
Includes the manifest information from the given manifest file. Includes the manifest information from the given manifest file.
.RS
.RE
.TP .TP
.B \f[CB]\-M\f[R] or \f[CB]\-\-no\-manifest\f[R] \f[V]-M\f[R] or \f[V]--no-manifest\f[R]
Doesn\[aq]t create a manifest file for the entries. Doesn\[aq]t create a manifest file for the entries.
.RS
.RE
.TP .TP
.B \f[CB]\-\-module\-version=\f[R]\f[I]VERSION\f[R] \f[V]--module-version=\f[R]\f[I]VERSION\f[R]
Specifies the module version, when creating or updating a modular JAR Specifies the module version, when creating or updating a modular JAR
file, or updating a non\-modular JAR file. file, or updating a non-modular JAR file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-hash\-modules=\f[R]\f[I]PATTERN\f[R] \f[V]--hash-modules=\f[R]\f[I]PATTERN\f[R]
Computes and records the hashes of modules matched by the given pattern Computes and records the hashes of modules matched by the given pattern
and that depend upon directly or indirectly on a modular JAR file being and that depend upon directly or indirectly on a modular JAR file being
created or a non\-modular JAR file being updated. created or a non-modular JAR file being updated.
.RS
.RE
.TP .TP
.B \f[CB]\-p\f[R] or \f[CB]\-\-module\-path\f[R] \f[V]-p\f[R] or \f[V]--module-path\f[R]
Specifies the location of module dependence for generating the hash. Specifies the location of module dependence for generating the hash.
.RS
.RE
.TP .TP
.B \f[CB]\@\f[R]\f[I]file\f[R] \f[V]\[at]\f[R]\f[I]file\f[R]
Reads \f[CB]jar\f[R] options and file names from a text file. Reads \f[V]jar\f[R] options and file names from a text file.
.RS .SH OPERATION MODIFIERS VALID ONLY IN CREATE, UPDATE, AND GENERATE-INDEX MODES
.RE
.SH OPERATION MODIFIERS VALID ONLY IN CREATE, UPDATE, AND
GENERATE\-INDEX MODES
.PP .PP
You can use the following options to customize the actions of the create You can use the following options to customize the actions of the create
(\f[CB]\-c\f[R] or \f[CB]\-\-create\f[R]) the update (\f[CB]\-u\f[R] or (\f[V]-c\f[R] or \f[V]--create\f[R]) the update (\f[V]-u\f[R] or
\f[CB]\-\-update\f[R] ) and the generate\-index (\f[CB]\-i\f[R] or \f[V]--update\f[R] ) and the generate-index (\f[V]-i\f[R] or
\f[CB]\-\-generate\-index=\f[R]\f[I]FILE\f[R]) main operation modes: \f[V]--generate-index=\f[R]\f[I]FILE\f[R]) main operation modes:
.TP .TP
.B \f[CB]\-0\f[R] or \f[CB]\-\-no\-compress\f[R] \f[V]-0\f[R] or \f[V]--no-compress\f[R]
Stores without using ZIP compression. Stores without using ZIP compression.
.RS
.RE
.TP .TP
.B \f[CB]\-\-date=\f[R]\f[I]TIMESTAMP\f[R] \f[V]--date=\f[R]\f[I]TIMESTAMP\f[R]
The timestamp in ISO\-8601 extended offset date\-time with optional The timestamp in ISO-8601 extended offset date-time with optional
time\-zone format, to use for the timestamp of the entries, e.g. time-zone format, to use for the timestamp of the entries, e.g.
"2022\-02\-12T12:30:00\-05:00". \[dq]2022-02-12T12:30:00-05:00\[dq].
.RS
.RE
.SH OTHER OPTIONS .SH OTHER OPTIONS
.PP .PP
The following options are recognized by the \f[CB]jar\f[R] command and not The following options are recognized by the \f[V]jar\f[R] command and
used with operation modes: not used with operation modes:
.TP .TP
.B \f[CB]\-h\f[R] or \f[CB]\-\-help\f[R][\f[CB]:compat\f[R]] \f[V]-h\f[R] or \f[V]--help\f[R][\f[V]:compat\f[R]]
Displays the command\-line help for the \f[CB]jar\f[R] command or Displays the command-line help for the \f[V]jar\f[R] command or
optionally the compatibility help. optionally the compatibility help.
.RS
.RE
.TP .TP
.B \f[CB]\-\-help\-extra\f[R] \f[V]--help-extra\f[R]
Displays help on extra options. Displays help on extra options.
.RS
.RE
.TP .TP
.B \f[CB]\-\-version\f[R] \f[V]--version\f[R]
Prints the program version. Prints the program version.
.RS
.RE
.SH EXAMPLES OF JAR COMMAND SYNTAX .SH EXAMPLES OF JAR COMMAND SYNTAX
.IP \[bu] 2 .IP \[bu] 2
Create an archive, \f[CB]classes.jar\f[R], that contains two class files, Create an archive, \f[V]classes.jar\f[R], that contains two class files,
\f[CB]Foo.class\f[R] and \f[CB]Bar.class\f[R]. \f[V]Foo.class\f[R] and \f[V]Bar.class\f[R].
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]jar\ \-\-create\ \-\-file\ classes.jar\ Foo.class\ Bar.class\f[R] \f[V]jar --create --file classes.jar Foo.class Bar.class\f[R]
.RE .RE
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
Create an archive, \f[CB]classes.jar\f[R], that contains two class files, Create an archive, \f[V]classes.jar\f[R], that contains two class files,
\f[CB]Foo.class\f[R] and \f[CB]Bar.class\f[R] setting the last modified date \f[V]Foo.class\f[R] and \f[V]Bar.class\f[R] setting the last modified
and time to \f[CB]2021\ Jan\ 6\ 12:36:00\f[R]. date and time to \f[V]2021 Jan 6 12:36:00\f[R].
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]jar\ \-\-create\ \-\-date="2021\-01\-06T14:36:00+02:00"\ \-\-file=classes.jar\ Foo.class\ Bar.class\f[R] \f[V]jar --create --date=\[dq]2021-01-06T14:36:00+02:00\[dq] --file=classes.jar Foo.class Bar.class\f[R]
.RE .RE
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
Create an archive, \f[CB]classes.jar\f[R], by using an existing manifest, Create an archive, \f[V]classes.jar\f[R], by using an existing manifest,
\f[CB]mymanifest\f[R], that contains all of the files in the directory \f[V]mymanifest\f[R], that contains all of the files in the directory
\f[CB]foo/\f[R]. \f[V]foo/\f[R].
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]jar\ \-\-create\ \-\-file\ classes.jar\ \-\-manifest\ mymanifest\ \-C\ foo/\f[R] \f[V]jar --create --file classes.jar --manifest mymanifest -C foo/\f[R]
.RE .RE
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
Create a modular JAR archive,\f[CB]foo.jar\f[R], where the module Create a modular JAR archive,\f[V]foo.jar\f[R], where the module
descriptor is located in \f[CB]classes/module\-info.class\f[R]. descriptor is located in \f[V]classes/module-info.class\f[R].
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]jar\ \-\-create\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Main\ \-\-module\-version\ 1.0\ \-C\ foo/classes\ resources\f[R] \f[V]jar --create --file foo.jar --main-class com.foo.Main --module-version 1.0 -C foo/classes resources\f[R]
.RE .RE
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
Update an existing non\-modular JAR, \f[CB]foo.jar\f[R], to a modular JAR Update an existing non-modular JAR, \f[V]foo.jar\f[R], to a modular JAR
file. file.
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]jar\ \-\-update\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Main\ \-\-module\-version\ 1.0\ \-C\ foo/module\-info.class\f[R] \f[V]jar --update --file foo.jar --main-class com.foo.Main --module-version 1.0 -C foo/module-info.class\f[R]
.RE .RE
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
Create a versioned or multi\-release JAR, \f[CB]foo.jar\f[R], that places Create a versioned or multi-release JAR, \f[V]foo.jar\f[R], that places
the files in the \f[CB]classes\f[R] directory at the root of the JAR, and the files in the \f[V]classes\f[R] directory at the root of the JAR, and
the files in the \f[CB]classes\-10\f[R] directory in the the files in the \f[V]classes-10\f[R] directory in the
\f[CB]META\-INF/versions/10\f[R] directory of the JAR. \f[V]META-INF/versions/10\f[R] directory of the JAR.
.RS 2 .RS 2
.PP .PP
In this example, the \f[CB]classes/com/foo\f[R] directory contains two In this example, the \f[V]classes/com/foo\f[R] directory contains two
classes, \f[CB]com.foo.Hello\f[R] (the entry point class) and classes, \f[V]com.foo.Hello\f[R] (the entry point class) and
\f[CB]com.foo.NameProvider\f[R], both compiled for JDK 8. \f[V]com.foo.NameProvider\f[R], both compiled for JDK 8.
The \f[CB]classes\-10/com/foo\f[R] directory contains a different version The \f[V]classes-10/com/foo\f[R] directory contains a different version
of the \f[CB]com.foo.NameProvider\f[R] class, this one containing JDK 10 of the \f[V]com.foo.NameProvider\f[R] class, this one containing JDK 10
specific code and compiled for JDK 10. specific code and compiled for JDK 10.
.PP .PP
Given this setup, create a multirelease JAR file \f[CB]foo.jar\f[R] by Given this setup, create a multirelease JAR file \f[V]foo.jar\f[R] by
running the following command from the directory containing the running the following command from the directory containing the
directories \f[CB]classes\f[R] and \f[CB]classes\-10\f[R] . directories \f[V]classes\f[R] and \f[V]classes-10\f[R] .
.RS .RS
.PP .PP
\f[CB]jar\ \-\-create\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Hello\ \-C\ classes\ .\ \-\-release\ 10\ \-C\ classes\-10\ .\f[R] \f[V]jar --create --file foo.jar --main-class com.foo.Hello -C classes . --release 10 -C classes-10 .\f[R]
.RE .RE
.PP .PP
The JAR file \f[CB]foo.jar\f[R] now contains: The JAR file \f[V]foo.jar\f[R] now contains:
.IP .IP
.nf .nf
\f[CB] \f[CB]
%\ jar\ \-tf\ foo.jar % jar -tf foo.jar
META\-INF/ META-INF/
META\-INF/MANIFEST.MF META-INF/MANIFEST.MF
com/ com/
com/foo/ com/foo/
com/foo/Hello.class com/foo/Hello.class
com/foo/NameProvider.class com/foo/NameProvider.class
META\-INF/versions/10/com/ META-INF/versions/10/com/
META\-INF/versions/10/com/foo/ META-INF/versions/10/com/foo/
META\-INF/versions/10/com/foo/NameProvider.class META-INF/versions/10/com/foo/NameProvider.class
\f[R] \f[R]
.fi .fi
.PP .PP
As well as other information, the file \f[CB]META\-INF/MANIFEST.MF\f[R], As well as other information, the file \f[V]META-INF/MANIFEST.MF\f[R],
will contain the following lines to indicate that this is a multirelease will contain the following lines to indicate that this is a multirelease
JAR file with an entry point of \f[CB]com.foo.Hello\f[R]. JAR file with an entry point of \f[V]com.foo.Hello\f[R].
.IP .IP
.nf .nf
\f[CB] \f[CB]
\&... \&...
Main\-Class:\ com.foo.Hello Main-Class: com.foo.Hello
Multi\-Release:\ true Multi-Release: true
\f[R] \f[R]
.fi .fi
.PP .PP
Assuming that the \f[CB]com.foo.Hello\f[R] class calls a method on the Assuming that the \f[V]com.foo.Hello\f[R] class calls a method on the
\f[CB]com.foo.NameProvider\f[R] class, running the program using JDK 10 \f[V]com.foo.NameProvider\f[R] class, running the program using JDK 10
will ensure that the \f[CB]com.foo.NameProvider\f[R] class is the one in will ensure that the \f[V]com.foo.NameProvider\f[R] class is the one in
\f[CB]META\-INF/versions/10/com/foo/\f[R]. \f[V]META-INF/versions/10/com/foo/\f[R].
Running the program using JDK 8 will ensure that the Running the program using JDK 8 will ensure that the
\f[CB]com.foo.NameProvider\f[R] class is the one at the root of the JAR, \f[V]com.foo.NameProvider\f[R] class is the one at the root of the JAR,
in \f[CB]com/foo\f[R]. in \f[V]com/foo\f[R].
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
Create an archive, \f[CB]my.jar\f[R], by reading options and lists of Create an archive, \f[V]my.jar\f[R], by reading options and lists of
class files from the file \f[CB]classes.list\f[R]. class files from the file \f[V]classes.list\f[R].
.RS 2 .RS 2
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
To shorten or simplify the \f[CB]jar\f[R] command, you can specify To shorten or simplify the \f[V]jar\f[R] command, you can specify
arguments in a separate text file and pass it to the \f[CB]jar\f[R] arguments in a separate text file and pass it to the \f[V]jar\f[R]
command with the at sign (\f[CB]\@\f[R]) as a prefix. command with the at sign (\f[V]\[at]\f[R]) as a prefix.
.RS .RS
.PP .PP
\f[CB]jar\ \-\-create\ \-\-file\ my.jar\ \@classes.list\f[R] \f[V]jar --create --file my.jar \[at]classes.list\f[R]
.RE .RE
.RE .RE

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -19,87 +19,85 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JINFO" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JINFO" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jinfo \- generate Java configuration information for a specified Java jinfo - generate Java configuration information for a specified Java
process process
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[B]Note:\f[R] This command is experimental and unsupported. \f[B]Note:\f[R] This command is experimental and unsupported.
.PP .PP
\f[CB]jinfo\f[R] [\f[I]option\f[R]] \f[I]pid\f[R] \f[V]jinfo\f[R] [\f[I]option\f[R]] \f[I]pid\f[R]
.TP .TP
.B \f[I]option\f[R] \f[I]option\f[R]
This represents the \f[CB]jinfo\f[R] command\-line options. This represents the \f[V]jinfo\f[R] command-line options.
See \f[B]Options for the jinfo Command\f[R]. See \f[B]Options for the jinfo Command\f[R].
.RS
.RE
.TP .TP
.B \f[I]pid\f[R] \f[I]pid\f[R]
The process ID for which the configuration information is to be printed. The process ID for which the configuration information is to be printed.
The process must be a Java process. The process must be a Java process.
To get a list of Java processes running on a machine, use either the To get a list of Java processes running on a machine, use either the
\f[CB]ps\f[R] command or, if the JVM processes are not running in a \f[V]ps\f[R] command or, if the JVM processes are not running in a
separate docker instance, the \f[B]jps\f[R] command. separate docker instance, the \f[B]jps\f[R] command.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jinfo\f[R] command prints Java configuration information for a The \f[V]jinfo\f[R] command prints Java configuration information for a
specified Java process. specified Java process.
The configuration information includes Java system properties and JVM The configuration information includes Java system properties and JVM
command\-line flags. command-line flags.
If the specified process is running on a 64\-bit JVM, then you might If the specified process is running on a 64-bit JVM, then you might need
need to specify the \f[CB]\-J\-d64\f[R] option, for example: to specify the \f[V]-J-d64\f[R] option, for example:
.RS .RS
.PP .PP
\f[CB]jinfo\ \-J\-d64\ \-sysprops\f[R] \f[I]pid\f[R] \f[V]jinfo -J-d64 -sysprops\f[R] \f[I]pid\f[R]
.RE .RE
.PP .PP
This command is unsupported and might not be available in future This command is unsupported and might not be available in future
releases of the JDK. releases of the JDK.
In Windows Systems where \f[CB]dbgeng.dll\f[R] is not present, the In Windows Systems where \f[V]dbgeng.dll\f[R] is not present, the
Debugging Tools for Windows must be installed to have these tools work. Debugging Tools for Windows must be installed to have these tools work.
The \f[CB]PATH\f[R] environment variable should contain the location of The \f[V]PATH\f[R] environment variable should contain the location of
the \f[CB]jvm.dll\f[R] that\[aq]s used by the target process or the the \f[V]jvm.dll\f[R] that\[aq]s used by the target process or the
location from which the core dump file was produced. location from which the core dump file was produced.
.SH OPTIONS FOR THE JINFO COMMAND .SH OPTIONS FOR THE JINFO COMMAND
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
If none of the following options are used, both the command\-line flags If none of the following options are used, both the command-line flags
and the system property name\-value pairs are printed. and the system property name-value pairs are printed.
.TP .TP
.B \f[CB]\-flag\f[R] \f[I]name\f[R] \f[V]-flag\f[R] \f[I]name\f[R]
Prints the name and value of the specified command\-line flag. Prints the name and value of the specified command-line flag.
.RS
.RE
.TP .TP
.B \f[CB]\-flag\f[R] [\f[CB]+\f[R]|\f[CB]\-\f[R]]\f[I]name\f[R] \f[V]-flag\f[R] [\f[V]+\f[R]|\f[V]-\f[R]]\f[I]name\f[R]
Enables or disables the specified Boolean command\-line flag. Enables or disables the specified Boolean command-line flag.
.RS
.RE
.TP .TP
.B \f[CB]\-flag\f[R] \f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R] \f[V]-flag\f[R] \f[I]name\f[R]\f[V]=\f[R]\f[I]value\f[R]
Sets the specified command\-line flag to the specified value. Sets the specified command-line flag to the specified value.
.RS
.RE
.TP .TP
.B \f[CB]\-flags\f[R] \f[V]-flags\f[R]
Prints command\-line flags passed to the JVM. Prints command-line flags passed to the JVM.
.RS
.RE
.TP .TP
.B \f[CB]\-sysprops\f[R] \f[V]-sysprops\f[R]
Prints Java system properties as name\-value pairs. Prints Java system properties as name-value pairs.
.RS
.RE
.TP .TP
.B \f[CB]\-h\f[R] or \f[CB]\-help\f[R] \f[V]-h\f[R] or \f[V]-help\f[R]
Prints a help message. Prints a help message.
.RS
.RE

View file

@ -19,83 +19,88 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JMAP" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JMAP" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jmap \- print details of a specified process jmap - print details of a specified process
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[B]Note:\f[R] This command is experimental and unsupported. \f[B]Note:\f[R] This command is experimental and unsupported.
.PP .PP
\f[CB]jmap\f[R] [\f[I]options\f[R]] \f[I]pid\f[R] \f[V]jmap\f[R] [\f[I]options\f[R]] \f[I]pid\f[R]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
This represents the \f[CB]jmap\f[R] command\-line options. This represents the \f[V]jmap\f[R] command-line options.
See \f[B]Options for the jmap Command\f[R]. See \f[B]Options for the jmap Command\f[R].
.RS
.RE
.TP .TP
.B \f[I]pid\f[R] \f[I]pid\f[R]
The process ID for which the information specified by the The process ID for which the information specified by the
\f[I]options\f[R] is to be printed. \f[I]options\f[R] is to be printed.
The process must be a Java process. The process must be a Java process.
To get a list of Java processes running on a machine, use either the To get a list of Java processes running on a machine, use either the
\f[CB]ps\f[R] command or, if the JVM processes are not running in a \f[V]ps\f[R] command or, if the JVM processes are not running in a
separate docker instance, the \f[B]jps\f[R] command. separate docker instance, the \f[B]jps\f[R] command.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jmap\f[R] command prints details of a specified running process. The \f[V]jmap\f[R] command prints details of a specified running
process.
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
This command is unsupported and might not be available in future This command is unsupported and might not be available in future
releases of the JDK. releases of the JDK.
On Windows Systems where the \f[CB]dbgeng.dll\f[R] file isn\[aq]t present, On Windows Systems where the \f[V]dbgeng.dll\f[R] file isn\[aq]t
the Debugging Tools for Windows must be installed to make these tools present, the Debugging Tools for Windows must be installed to make these
work. tools work.
The \f[CB]PATH\f[R] environment variable should contain the location of The \f[V]PATH\f[R] environment variable should contain the location of
the \f[CB]jvm.dll\f[R] file that\[aq]s used by the target process or the the \f[V]jvm.dll\f[R] file that\[aq]s used by the target process or the
location from which the core dump file was produced. location from which the core dump file was produced.
.SH OPTIONS FOR THE JMAP COMMAND .SH OPTIONS FOR THE JMAP COMMAND
.TP .TP
.B \f[CB]\-clstats\f[R] \f[I]pid\f[R] \f[V]-clstats\f[R] \f[I]pid\f[R]
Connects to a running process and prints class loader statistics of Java Connects to a running process and prints class loader statistics of Java
heap. heap.
.RS
.RE
.TP .TP
.B \f[CB]\-finalizerinfo\f[R] \f[I]pid\f[R] \f[V]-finalizerinfo\f[R] \f[I]pid\f[R]
Connects to a running process and prints information on objects awaiting Connects to a running process and prints information on objects awaiting
finalization. finalization.
.RS
.RE
.TP .TP
.B \f[CB]\-histo\f[R][\f[CB]:live\f[R]] \f[I]pid\f[R] \f[V]-histo\f[R][\f[V]:live\f[R]] \f[I]pid\f[R]
Connects to a running process and prints a histogram of the Java object Connects to a running process and prints a histogram of the Java object
heap. heap.
If the \f[CB]live\f[R] suboption is specified, it then counts only live If the \f[V]live\f[R] suboption is specified, it then counts only live
objects. objects.
.RS
.RE
.TP .TP
.B \f[CB]\-dump:\f[R]\f[I]dump_options\f[R] \f[I]pid\f[R] \f[V]-dump:\f[R]\f[I]dump_options\f[R] \f[I]pid\f[R]
Connects to a running process and dumps the Java heap. Connects to a running process and dumps the Java heap.
The \f[I]dump_options\f[R] include: The \f[I]dump_options\f[R] include:
.RS .RS
.IP \[bu] 2 .IP \[bu] 2
\f[CB]live\f[R] \-\-\- When specified, dumps only the live objects; if not \f[V]live\f[R] --- When specified, dumps only the live objects; if not
specified, then dumps all objects in the heap. specified, then dumps all objects in the heap.
.IP \[bu] 2 .IP \[bu] 2
\f[CB]format=b\f[R] \-\-\- Dumps the Java heap in \f[CB]hprof\f[R] binary \f[V]format=b\f[R] --- Dumps the Java heap in \f[V]hprof\f[R] binary
format format
.IP \[bu] 2 .IP \[bu] 2
\f[CB]file=\f[R]\f[I]filename\f[R] \-\-\- Dumps the heap to \f[V]file=\f[R]\f[I]filename\f[R] --- Dumps the heap to
\f[I]filename\f[R] \f[I]filename\f[R]
.PP .PP
Example: \f[CB]jmap\ \-dump:live,format=b,file=heap.bin\f[R] \f[I]pid\f[R] Example: \f[V]jmap -dump:live,format=b,file=heap.bin\f[R] \f[I]pid\f[R]
.RE .RE

View file

@ -19,215 +19,217 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JPS" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JPS" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jps \- list the instrumented JVMs on the target system jps - list the instrumented JVMs on the target system
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[B]Note:\f[R] This command is experimental and unsupported. \f[B]Note:\f[R] This command is experimental and unsupported.
.PP .PP
\f[CB]jps\f[R] [\f[CB]\-q\f[R]] [\f[CB]\-mlvV\f[R]] [\f[I]hostid\f[R]] \f[V]jps\f[R] [\f[V]-q\f[R]] [\f[V]-mlvV\f[R]] [\f[I]hostid\f[R]]
.PP .PP
\f[CB]jps\f[R] [\f[CB]\-help\f[R]] \f[V]jps\f[R] [\f[V]-help\f[R]]
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \f[CB]\-q\f[R] \f[V]-q\f[R]
Suppresses the output of the class name, JAR file name, and arguments Suppresses the output of the class name, JAR file name, and arguments
passed to the \f[CB]main\f[R] method, producing a list of only local JVM passed to the \f[V]main\f[R] method, producing a list of only local JVM
identifiers. identifiers.
.RS
.RE
.TP .TP
.B \f[CB]\-mlvV\f[R] \f[V]-mlvV\f[R]
You can specify any combination of these options. You can specify any combination of these options.
.RS .RS
.IP \[bu] 2 .IP \[bu] 2
\f[CB]\-m\f[R] displays the arguments passed to the \f[CB]main\f[R] method. \f[V]-m\f[R] displays the arguments passed to the \f[V]main\f[R] method.
The output may be \f[CB]null\f[R] for embedded JVMs. The output may be \f[V]null\f[R] for embedded JVMs.
.IP \[bu] 2 .IP \[bu] 2
\f[CB]\-l\f[R] displays the full package name for the application\[aq]s \f[V]-l\f[R] displays the full package name for the application\[aq]s
\f[CB]main\f[R] class or the full path name to the application\[aq]s JAR \f[V]main\f[R] class or the full path name to the application\[aq]s JAR
file. file.
.IP \[bu] 2 .IP \[bu] 2
\f[CB]\-v\f[R] displays the arguments passed to the JVM. \f[V]-v\f[R] displays the arguments passed to the JVM.
.IP \[bu] 2 .IP \[bu] 2
\f[CB]\-V\f[R] suppresses the output of the class name, JAR file name, and \f[V]-V\f[R] suppresses the output of the class name, JAR file name, and
arguments passed to the \f[CB]main\f[R] method, producing a list of only arguments passed to the \f[V]main\f[R] method, producing a list of only
local JVM identifiers. local JVM identifiers.
.RE .RE
.TP .TP
.B \f[I]hostid\f[R] \f[I]hostid\f[R]
The identifier of the host for which the process report should be The identifier of the host for which the process report should be
generated. generated.
The \f[CB]hostid\f[R] can include optional components that indicate the The \f[V]hostid\f[R] can include optional components that indicate the
communications protocol, port number, and other implementation specific communications protocol, port number, and other implementation specific
data. data.
See \f[B]Host Identifier\f[R]. See \f[B]Host Identifier\f[R].
.RS
.RE
.TP .TP
.B \f[CB]\-help\f[R] \f[V]-help\f[R]
Displays the help message for the \f[CB]jps\f[R] command. Displays the help message for the \f[V]jps\f[R] command.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jps\f[R] command lists the instrumented Java HotSpot VMs on the The \f[V]jps\f[R] command lists the instrumented Java HotSpot VMs on the
target system. target system.
The command is limited to reporting information on JVMs for which it has The command is limited to reporting information on JVMs for which it has
the access permissions. the access permissions.
.PP .PP
If the \f[CB]jps\f[R] command is run without specifying a \f[CB]hostid\f[R], If the \f[V]jps\f[R] command is run without specifying a
then it searches for instrumented JVMs on the local host. \f[V]hostid\f[R], then it searches for instrumented JVMs on the local
If started with a \f[CB]hostid\f[R], then it searches for JVMs on the host.
If started with a \f[V]hostid\f[R], then it searches for JVMs on the
indicated host, using the specified protocol and port. indicated host, using the specified protocol and port.
A \f[CB]jstatd\f[R] process is assumed to be running on the target host. A \f[V]jstatd\f[R] process is assumed to be running on the target host.
.PP .PP
The \f[CB]jps\f[R] command reports the local JVM identifier, or The \f[V]jps\f[R] command reports the local JVM identifier, or
\f[CB]lvmid\f[R], for each instrumented JVM found on the target system. \f[V]lvmid\f[R], for each instrumented JVM found on the target system.
The \f[CB]lvmid\f[R] is typically, but not necessarily, the operating The \f[V]lvmid\f[R] is typically, but not necessarily, the operating
system\[aq]s process identifier for the JVM process. system\[aq]s process identifier for the JVM process.
With no options, the \f[CB]jps\f[R] command lists each Java With no options, the \f[V]jps\f[R] command lists each Java
application\[aq]s \f[CB]lvmid\f[R] followed by the short form of the application\[aq]s \f[V]lvmid\f[R] followed by the short form of the
application\[aq]s class name or jar file name. application\[aq]s class name or jar file name.
The short form of the class name or JAR file name omits the class\[aq]s The short form of the class name or JAR file name omits the class\[aq]s
package information or the JAR files path information. package information or the JAR files path information.
.PP .PP
The \f[CB]jps\f[R] command uses the Java launcher to find the class name The \f[V]jps\f[R] command uses the Java launcher to find the class name
and arguments passed to the main method. and arguments passed to the main method.
If the target JVM is started with a custom launcher, then the class or If the target JVM is started with a custom launcher, then the class or
JAR file name, and the arguments to the \f[CB]main\f[R] method aren\[aq]t JAR file name, and the arguments to the \f[V]main\f[R] method aren\[aq]t
available. available.
In this case, the \f[CB]jps\f[R] command outputs the string In this case, the \f[V]jps\f[R] command outputs the string
\f[CB]Unknown\f[R] for the class name, or JAR file name, and for the \f[V]Unknown\f[R] for the class name, or JAR file name, and for the
arguments to the \f[CB]main\f[R] method. arguments to the \f[V]main\f[R] method.
.PP .PP
The list of JVMs produced by the \f[CB]jps\f[R] command can be limited by The list of JVMs produced by the \f[V]jps\f[R] command can be limited by
the permissions granted to the principal running the command. the permissions granted to the principal running the command.
The command lists only the JVMs for which the principal has access The command lists only the JVMs for which the principal has access
rights as determined by operating system\-specific access control rights as determined by operating system-specific access control
mechanisms. mechanisms.
.SH HOST IDENTIFIER .SH HOST IDENTIFIER
.PP .PP
The host identifier, or \f[CB]hostid\f[R], is a string that indicates the The host identifier, or \f[V]hostid\f[R], is a string that indicates the
target system. target system.
The syntax of the \f[CB]hostid\f[R] string corresponds to the syntax of a The syntax of the \f[V]hostid\f[R] string corresponds to the syntax of a
URI: URI:
.RS .RS
.PP .PP
[\f[I]protocol\f[R]\f[CB]:\f[R]][[\f[CB]//\f[R]]\f[I]hostname\f[R]][\f[CB]:\f[R]\f[I]port\f[R]][\f[CB]/\f[R]\f[I]servername\f[R]] [\f[I]protocol\f[R]\f[V]:\f[R]][[\f[V]//\f[R]]\f[I]hostname\f[R]][\f[V]:\f[R]\f[I]port\f[R]][\f[V]/\f[R]\f[I]servername\f[R]]
.RE .RE
.TP .TP
.B \f[I]protocol\f[R] \f[I]protocol\f[R]
The communications protocol. The communications protocol.
If the \f[I]protocol\f[R] is omitted and a \f[I]hostname\f[R] isn\[aq]t If the \f[I]protocol\f[R] is omitted and a \f[I]hostname\f[R] isn\[aq]t
specified, then the default protocol is a platform\-specific, optimized, specified, then the default protocol is a platform-specific, optimized,
local protocol. local protocol.
If the protocol is omitted and a host name is specified, then the If the protocol is omitted and a host name is specified, then the
default protocol is \f[CB]rmi\f[R]. default protocol is \f[V]rmi\f[R].
.RS
.RE
.TP .TP
.B \f[I]hostname\f[R] \f[I]hostname\f[R]
A host name or IP address that indicates the target host. A host name or IP address that indicates the target host.
If you omit the \f[I]hostname\f[R] parameter, then the target host is the If you omit the \f[I]hostname\f[R] parameter, then the target host is
local host. the local host.
.RS
.RE
.TP .TP
.B \f[I]port\f[R] \f[I]port\f[R]
The default port for communicating with the remote server. The default port for communicating with the remote server.
If the \f[I]hostname\f[R] parameter is omitted or the \f[I]protocol\f[R] If the \f[I]hostname\f[R] parameter is omitted or the \f[I]protocol\f[R]
parameter specifies an optimized, local protocol, then the \f[I]port\f[R] parameter specifies an optimized, local protocol, then the
parameter is ignored. \f[I]port\f[R] parameter is ignored.
Otherwise, treatment of the \f[I]port\f[R] parameter is Otherwise, treatment of the \f[I]port\f[R] parameter is
implementation\-specific. implementation-specific.
For the default \f[CB]rmi\f[R] protocol, the \f[I]port\f[R] parameter For the default \f[V]rmi\f[R] protocol, the \f[I]port\f[R] parameter
indicates the port number for the \f[CB]rmiregistry\f[R] on the remote indicates the port number for the \f[V]rmiregistry\f[R] on the remote
host. host.
If the \f[I]port\f[R] parameter is omitted, and the \f[I]protocol\f[R] If the \f[I]port\f[R] parameter is omitted, and the \f[I]protocol\f[R]
parameter indicates \f[CB]rmi\f[R], then the default \f[CB]rmiregistry\f[R] parameter indicates \f[V]rmi\f[R], then the default
port (\f[CB]1099\f[R]) is used. \f[V]rmiregistry\f[R] port (\f[V]1099\f[R]) is used.
.RS
.RE
.TP .TP
.B \f[I]servername\f[R] \f[I]servername\f[R]
The treatment of this parameter depends on the implementation. The treatment of this parameter depends on the implementation.
For the optimized, local protocol, this field is ignored. For the optimized, local protocol, this field is ignored.
For the \f[CB]rmi\f[R] protocol, this parameter is a string that For the \f[V]rmi\f[R] protocol, this parameter is a string that
represents the name of the RMI remote object on the remote host. represents the name of the RMI remote object on the remote host.
See the \f[B]jstatd\f[R] command \f[CB]\-n\f[R] option. See the \f[B]jstatd\f[R] command \f[V]-n\f[R] option.
.RS
.RE
.SH OUTPUT FORMAT OF THE JPS COMMAND .SH OUTPUT FORMAT OF THE JPS COMMAND
.PP .PP
The output of the \f[CB]jps\f[R] command has the following pattern: The output of the \f[V]jps\f[R] command has the following pattern:
.RS .RS
.PP .PP
\f[I]lvmid\f[R] [ [ \f[I]classname\f[R] | \f[I]JARfilename\f[R] | \f[I]lvmid\f[R] [ [ \f[I]classname\f[R] | \f[I]JARfilename\f[R] |
\f[CB]"Unknown"\f[R]] [ \f[I]arg\f[R]* ] [ \f[I]jvmarg\f[R]* ] ] \f[V]\[dq]Unknown\[dq]\f[R]] [ \f[I]arg\f[R]* ] [ \f[I]jvmarg\f[R]* ] ]
.RE .RE
.PP .PP
All output tokens are separated by white space. All output tokens are separated by white space.
An \f[CB]arg\f[R] value that includes embedded white space introduces An \f[V]arg\f[R] value that includes embedded white space introduces
ambiguity when attempting to map arguments to their actual positional ambiguity when attempting to map arguments to their actual positional
parameters. parameters.
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
It\[aq]s recommended that you don\[aq]t write scripts to parse It\[aq]s recommended that you don\[aq]t write scripts to parse
\f[CB]jps\f[R] output because the format might change in future releases. \f[V]jps\f[R] output because the format might change in future releases.
If you write scripts that parse \f[CB]jps\f[R] output, then expect to If you write scripts that parse \f[V]jps\f[R] output, then expect to
modify them for future releases of this tool. modify them for future releases of this tool.
.SH EXAMPLES .SH EXAMPLES
.PP .PP
This section provides examples of the \f[CB]jps\f[R] command. This section provides examples of the \f[V]jps\f[R] command.
.PP .PP
List the instrumented JVMs on the local host: List the instrumented JVMs on the local host:
.IP .IP
.nf .nf
\f[CB] \f[CB]
jps jps
18027\ Java2Demo.JAR 18027 Java2Demo.JAR
18032\ jps 18032 jps
18005\ jstat 18005 jstat
\f[R] \f[R]
.fi .fi
.PP .PP
The following example lists the instrumented JVMs on a remote host. The following example lists the instrumented JVMs on a remote host.
This example assumes that the \f[CB]jstat\f[R] server and either the its This example assumes that the \f[V]jstat\f[R] server and either the its
internal RMI registry or a separate external \f[CB]rmiregistry\f[R] internal RMI registry or a separate external \f[V]rmiregistry\f[R]
process are running on the remote host on the default port (port process are running on the remote host on the default port (port
\f[CB]1099\f[R]). \f[V]1099\f[R]).
It also assumes that the local host has appropriate permissions to It also assumes that the local host has appropriate permissions to
access the remote host. access the remote host.
This example includes the \f[CB]\-l\f[R] option to output the long form of This example includes the \f[V]-l\f[R] option to output the long form of
the class names or JAR file names. the class names or JAR file names.
.IP .IP
.nf .nf
\f[CB] \f[CB]
jps\ \-l\ remote.domain jps -l remote.domain
3002\ /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR 3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
2857\ sun.tools.jstatd.jstatd 2857 sun.tools.jstatd.jstatd
\f[R] \f[R]
.fi .fi
.PP .PP
The following example lists the instrumented JVMs on a remote host with The following example lists the instrumented JVMs on a remote host with
a nondefault port for the RMI registry. a nondefault port for the RMI registry.
This example assumes that the \f[CB]jstatd\f[R] server, with an internal This example assumes that the \f[V]jstatd\f[R] server, with an internal
RMI registry bound to port \f[CB]2002\f[R], is running on the remote host. RMI registry bound to port \f[V]2002\f[R], is running on the remote
This example also uses the \f[CB]\-m\f[R] option to include the arguments host.
passed to the \f[CB]main\f[R] method of each of the listed Java This example also uses the \f[V]-m\f[R] option to include the arguments
passed to the \f[V]main\f[R] method of each of the listed Java
applications. applications.
.IP .IP
.nf .nf
\f[CB] \f[CB]
jps\ \-m\ remote.domain:2002 jps -m remote.domain:2002
3002\ /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR 3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
3102\ sun.tools.jstatd.jstatd\ \-p\ 2002 3102 sun.tools.jstatd.jstatd -p 2002
\f[R] \f[R]
.fi .fi

View file

@ -19,65 +19,71 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JSTACK" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JSTACK" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jstack \- print Java stack traces of Java threads for a specified Java jstack - print Java stack traces of Java threads for a specified Java
process process
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[B]Note:\f[R] This command is experimental and unsupported. \f[B]Note:\f[R] This command is experimental and unsupported.
.PP .PP
\f[CB]jstack\f[R] [\f[I]options\f[R]] \f[I]pid\f[R] \f[V]jstack\f[R] [\f[I]options\f[R]] \f[I]pid\f[R]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
This represents the \f[CB]jstack\f[R] command\-line options. This represents the \f[V]jstack\f[R] command-line options.
See \f[B]Options for the jstack Command\f[R]. See \f[B]Options for the jstack Command\f[R].
.RS
.RE
.TP .TP
.B \f[I]pid\f[R] \f[I]pid\f[R]
The process ID for which the stack trace is printed. The process ID for which the stack trace is printed.
The process must be a Java process. The process must be a Java process.
To get a list of Java processes running on a machine, use either the To get a list of Java processes running on a machine, use either the
\f[CB]ps\f[R] command or, if the JVM processes are not running in a \f[V]ps\f[R] command or, if the JVM processes are not running in a
separate docker instance, the \f[B]jps\f[R] command. separate docker instance, the \f[B]jps\f[R] command.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jstack\f[R] command prints Java stack traces of Java threads for The \f[V]jstack\f[R] command prints Java stack traces of Java threads
a specified Java process. for a specified Java process.
For each Java frame, the full class name, method name, byte code index For each Java frame, the full class name, method name, byte code index
(BCI), and line number, when available, are printed. (BCI), and line number, when available, are printed.
C++ mangled names aren\[aq]t demangled. C++ mangled names aren\[aq]t demangled.
To demangle C++ names, the output of this command can be piped to To demangle C++ names, the output of this command can be piped to
\f[CB]c++filt\f[R]. \f[V]c++filt\f[R].
When the specified process is running on a 64\-bit JVM, you might need When the specified process is running on a 64-bit JVM, you might need to
to specify the \f[CB]\-J\-d64\f[R] option, for example: specify the \f[V]-J-d64\f[R] option, for example:
\f[CB]jstack\ \-J\-d64\f[R] \f[I]pid\f[R]. \f[V]jstack -J-d64\f[R] \f[I]pid\f[R].
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
This command is unsupported and might not be available in future This command is unsupported and might not be available in future
releases of the JDK. releases of the JDK.
In Windows Systems where the \f[CB]dbgeng.dll\f[R] file isn\[aq]t present, In Windows Systems where the \f[V]dbgeng.dll\f[R] file isn\[aq]t
the Debugging Tools for Windows must be installed so that these tools present, the Debugging Tools for Windows must be installed so that these
work. tools work.
The \f[CB]PATH\f[R] environment variable needs to contain the location of The \f[V]PATH\f[R] environment variable needs to contain the location of
the \f[CB]jvm.dll\f[R] that is used by the target process, or the location the \f[V]jvm.dll\f[R] that is used by the target process, or the
from which the core dump file was produced. location from which the core dump file was produced.
.SH OPTIONS FOR THE JSTACK COMMAND .SH OPTIONS FOR THE JSTACK COMMAND
.TP .TP
.B \f[CB]\-l\f[R] \f[V]-l\f[R]
The long listing option prints additional information about locks. The long listing option prints additional information about locks.
.RS
.RE
.TP .TP
.B \f[CB]\-h\f[R] or \f[CB]\-help\f[R] \f[V]-h\f[R] or \f[V]-help\f[R]
Prints a help message. Prints a help message.
.RS
.RE

View file

@ -19,86 +19,87 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JSTAT" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JSTAT" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jstat \- monitor JVM statistics jstat - monitor JVM statistics
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[B]Note:\f[R] This command is experimental and unsupported. \f[B]Note:\f[R] This command is experimental and unsupported.
.PP .PP
\f[CB]jstat\f[R] \f[I]generalOptions\f[R] \f[V]jstat\f[R] \f[I]generalOptions\f[R]
.PP .PP
\f[CB]jstat\f[R] \f[I]outputOptions\f[R] [\f[CB]\-t\f[R]] [\f[CB]\-h\f[R] \f[V]jstat\f[R] \f[I]outputOptions\f[R] [\f[V]-t\f[R]] [\f[V]-h\f[R]
\f[I]lines\f[R]] \f[I]vmid\f[R] [\f[I]interval\f[R] [\f[I]count\f[R]]] \f[I]lines\f[R]] \f[I]vmid\f[R] [\f[I]interval\f[R] [\f[I]count\f[R]]]
.TP .TP
.B \f[I]generalOptions\f[R] \f[I]generalOptions\f[R]
A single general command\-line option. A single general command-line option.
See \f[B]General Options\f[R]. See \f[B]General Options\f[R].
.RS
.RE
.TP .TP
.B \f[I]outputOptions\f[R] \f[I]outputOptions\f[R]
An option reported by the \f[CB]\-options\f[R] option. An option reported by the \f[V]-options\f[R] option.
One or more output options that consist of a single \f[CB]statOption\f[R], One or more output options that consist of a single
plus any of the \f[CB]\-t\f[R], \f[CB]\-h\f[R], and \f[CB]\-J\f[R] options. \f[V]statOption\f[R], plus any of the \f[V]-t\f[R], \f[V]-h\f[R], and
\f[V]-J\f[R] options.
See \f[B]Output Options for the jstat Command\f[R]. See \f[B]Output Options for the jstat Command\f[R].
.RS
.RE
.TP .TP
.B \f[CB]\-t\f[R] \f[V]-t\f[R]
Displays a time\-stamp column as the first column of output. Displays a time-stamp column as the first column of output.
The time stamp is the time since the start time of the target JVM. The time stamp is the time since the start time of the target JVM.
.RS
.RE
.TP .TP
.B \f[CB]\-h\f[R] \f[I]n\f[R] \f[V]-h\f[R] \f[I]n\f[R]
Displays a column header every \f[I]n\f[R] samples (output rows), where Displays a column header every \f[I]n\f[R] samples (output rows), where
\f[I]n\f[R] is a positive integer. \f[I]n\f[R] is a positive integer.
The default value is \f[CB]0\f[R], which displays the column header of the The default value is \f[V]0\f[R], which displays the column header of
first row of data. the first row of data.
.RS
.RE
.TP .TP
.B \f[I]vmid\f[R] \f[I]vmid\f[R]
A virtual machine identifier, which is a string that indicates the A virtual machine identifier, which is a string that indicates the
target JVM. target JVM.
See \f[B]Virtual Machine Identifier\f[R]. See \f[B]Virtual Machine Identifier\f[R].
.RS
.RE
.TP .TP
.B \f[I]interval\f[R] \f[I]interval\f[R]
The sampling interval in the specified units, seconds (s) or The sampling interval in the specified units, seconds (s) or
milliseconds (ms). milliseconds (ms).
Default units are milliseconds. Default units are milliseconds.
This must be a positive integer. This must be a positive integer.
When specified, the \f[CB]jstat\f[R] command produces its output at each When specified, the \f[V]jstat\f[R] command produces its output at each
interval. interval.
.RS
.RE
.TP .TP
.B \f[I]count\f[R] \f[I]count\f[R]
The number of samples to display. The number of samples to display.
The default value is infinity, which causes the \f[CB]jstat\f[R] command The default value is infinity, which causes the \f[V]jstat\f[R] command
to display statistics until the target JVM terminates or the to display statistics until the target JVM terminates or the
\f[CB]jstat\f[R] command is terminated. \f[V]jstat\f[R] command is terminated.
This value must be a positive integer. This value must be a positive integer.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jstat\f[R] command displays performance statistics for an The \f[V]jstat\f[R] command displays performance statistics for an
instrumented Java HotSpot VM. instrumented Java HotSpot VM.
The target JVM is identified by its virtual machine identifier, or The target JVM is identified by its virtual machine identifier, or
\f[CB]vmid\f[R] option. \f[V]vmid\f[R] option.
.PP .PP
The \f[CB]jstat\f[R] command supports two types of options, general The \f[V]jstat\f[R] command supports two types of options, general
options and output options. options and output options.
General options cause the \f[CB]jstat\f[R] command to display simple usage General options cause the \f[V]jstat\f[R] command to display simple
and version information. usage and version information.
Output options determine the content and format of the statistical Output options determine the content and format of the statistical
output. output.
.PP .PP
@ -109,36 +110,32 @@ future releases.
If you specify one of the general options, then you can\[aq]t specify If you specify one of the general options, then you can\[aq]t specify
any other option or parameter. any other option or parameter.
.TP .TP
.B \f[CB]\-help\f[R] \f[V]-help\f[R]
Displays a help message. Displays a help message.
.RS
.RE
.TP .TP
.B \f[CB]\-options\f[R] \f[V]-options\f[R]
Displays a list of static options. Displays a list of static options.
See \f[B]Output Options for the jstat Command\f[R]. See \f[B]Output Options for the jstat Command\f[R].
.RS
.RE
.SH OUTPUT OPTIONS FOR THE JSTAT COMMAND .SH OUTPUT OPTIONS FOR THE JSTAT COMMAND
.PP .PP
If you don\[aq]t specify a general option, then you can specify output If you don\[aq]t specify a general option, then you can specify output
options. options.
Output options determine the content and format of the \f[CB]jstat\f[R] Output options determine the content and format of the \f[V]jstat\f[R]
command\[aq]s output, and consist of a single \f[CB]statOption\f[R], plus command\[aq]s output, and consist of a single \f[V]statOption\f[R], plus
any of the other output options (\f[CB]\-h\f[R], \f[CB]\-t\f[R], and any of the other output options (\f[V]-h\f[R], \f[V]-t\f[R], and
\f[CB]\-J\f[R]). \f[V]-J\f[R]).
The \f[CB]statOption\f[R] must come first. The \f[V]statOption\f[R] must come first.
.PP .PP
Output is formatted as a table, with columns that are separated by Output is formatted as a table, with columns that are separated by
spaces. spaces.
A header row with titles describes the columns. A header row with titles describes the columns.
Use the \f[CB]\-h\f[R] option to set the frequency at which the header is Use the \f[V]-h\f[R] option to set the frequency at which the header is
displayed. displayed.
Column header names are consistent among the different options. Column header names are consistent among the different options.
In general, if two options provide a column with the same name, then the In general, if two options provide a column with the same name, then the
data source for the two columns is the same. data source for the two columns is the same.
.PP .PP
Use the \f[CB]\-t\f[R] option to display a time\-stamp column, labeled Use the \f[V]-t\f[R] option to display a time-stamp column, labeled
Timestamp as the first column of output. Timestamp as the first column of output.
The Timestamp column contains the elapsed time, in seconds, since the The Timestamp column contains the elapsed time, in seconds, since the
target JVM started. target JVM started.
@ -147,448 +144,438 @@ subject to variation due to delayed thread scheduling on heavily loaded
systems. systems.
.PP .PP
Use the interval and count parameters to determine how frequently and Use the interval and count parameters to determine how frequently and
how many times, respectively, the \f[CB]jstat\f[R] command displays its how many times, respectively, the \f[V]jstat\f[R] command displays its
output. output.
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
Don\[aq]t write scripts to parse the \f[CB]jstat\f[R] command\[aq]s output Don\[aq]t write scripts to parse the \f[V]jstat\f[R] command\[aq]s
because the format might change in future releases. output because the format might change in future releases.
If you write scripts that parse the \f[CB]jstat\f[R] command output, then If you write scripts that parse the \f[V]jstat\f[R] command output, then
expect to modify them for future releases of this tool. expect to modify them for future releases of this tool.
.TP .TP
.B \f[CB]\-statOption\f[R] \f[V]-statOption\f[R]
Determines the statistics information that the \f[CB]jstat\f[R] command Determines the statistics information that the \f[V]jstat\f[R] command
displays. displays.
The following lists the available options. The following lists the available options.
Use the \f[CB]\-options\f[R] general option to display the list of options Use the \f[V]-options\f[R] general option to display the list of options
for a particular platform installation. for a particular platform installation.
See \f[B]Stat Options and Output\f[R]. See \f[B]Stat Options and Output\f[R].
.RS .RS
.PP .PP
\f[CB]class\f[R]: Displays statistics about the behavior of the class \f[V]class\f[R]: Displays statistics about the behavior of the class
loader. loader.
.PP .PP
\f[CB]compiler\f[R]: Displays statistics about the behavior of the Java \f[V]compiler\f[R]: Displays statistics about the behavior of the Java
HotSpot VM Just\-in\-Time compiler. HotSpot VM Just-in-Time compiler.
.PP .PP
\f[CB]gc\f[R]: Displays statistics about the behavior of the garbage \f[V]gc\f[R]: Displays statistics about the behavior of the garbage
collected heap. collected heap.
.PP .PP
\f[CB]gccapacity\f[R]: Displays statistics about the capacities of the \f[V]gccapacity\f[R]: Displays statistics about the capacities of the
generations and their corresponding spaces. generations and their corresponding spaces.
.PP .PP
\f[CB]gccause\f[R]: Displays a summary about garbage collection statistics \f[V]gccause\f[R]: Displays a summary about garbage collection
(same as \f[CB]\-gcutil\f[R]), with the cause of the last and current statistics (same as \f[V]-gcutil\f[R]), with the cause of the last and
(when applicable) garbage collection events. current (when applicable) garbage collection events.
.PP .PP
\f[CB]gcnew\f[R]: Displays statistics about the behavior of the new \f[V]gcnew\f[R]: Displays statistics about the behavior of the new
generation. generation.
.PP .PP
\f[CB]gcnewcapacity\f[R]: Displays statistics about the sizes of the new \f[V]gcnewcapacity\f[R]: Displays statistics about the sizes of the new
generations and their corresponding spaces. generations and their corresponding spaces.
.PP .PP
\f[CB]gcold\f[R]: Displays statistics about the behavior of the old \f[V]gcold\f[R]: Displays statistics about the behavior of the old
generation and metaspace statistics. generation and metaspace statistics.
.PP .PP
\f[CB]gcoldcapacity\f[R]: Displays statistics about the sizes of the old \f[V]gcoldcapacity\f[R]: Displays statistics about the sizes of the old
generation. generation.
.PP .PP
\f[CB]gcmetacapacity\f[R]: Displays statistics about the sizes of the \f[V]gcmetacapacity\f[R]: Displays statistics about the sizes of the
metaspace. metaspace.
.PP .PP
\f[CB]gcutil\f[R]: Displays a summary about garbage collection statistics. \f[V]gcutil\f[R]: Displays a summary about garbage collection
statistics.
.PP .PP
\f[CB]printcompilation\f[R]: Displays Java HotSpot VM compilation method \f[V]printcompilation\f[R]: Displays Java HotSpot VM compilation method
statistics. statistics.
.RE .RE
.TP .TP
.B \f[CB]\-J\f[R]\f[I]javaOption\f[R] \f[V]-J\f[R]\f[I]javaOption\f[R]
Passes \f[I]javaOption\f[R] to the Java application launcher. Passes \f[I]javaOption\f[R] to the Java application launcher.
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB. For example, \f[V]-J-Xms48m\f[R] sets the startup memory to 48 MB.
For a complete list of options, see \f[B]java\f[R]. For a complete list of options, see \f[B]java\f[R].
.RS
.RE
.SH STAT OPTIONS AND OUTPUT .SH STAT OPTIONS AND OUTPUT
.PP .PP
The following information summarizes the columns that the \f[CB]jstat\f[R] The following information summarizes the columns that the
command outputs for each \f[I]statOption\f[R]. \f[V]jstat\f[R] command outputs for each \f[I]statOption\f[R].
.TP .TP
.B \f[CB]\-class\f[R] \f[I]option\f[R] \f[V]-class\f[R] \f[I]option\f[R]
Class loader statistics. Class loader statistics.
.RS .RS
.PP .PP
\f[CB]Loaded\f[R]: Number of classes loaded. \f[V]Loaded\f[R]: Number of classes loaded.
.PP .PP
\f[CB]Bytes\f[R]: Number of KB loaded. \f[V]Bytes\f[R]: Number of KB loaded.
.PP .PP
\f[CB]Unloaded\f[R]: Number of classes unloaded. \f[V]Unloaded\f[R]: Number of classes unloaded.
.PP .PP
\f[CB]Bytes\f[R]: Number of KB unloaded. \f[V]Bytes\f[R]: Number of KB unloaded.
.PP .PP
\f[CB]Time\f[R]: Time spent performing class loading and unloading \f[V]Time\f[R]: Time spent performing class loading and unloading
operations. operations.
.RE .RE
.TP .TP
.B \f[CB]\-compiler\f[R] \f[I]option\f[R] \f[V]-compiler\f[R] \f[I]option\f[R]
Java HotSpot VM Just\-in\-Time compiler statistics. Java HotSpot VM Just-in-Time compiler statistics.
.RS .RS
.PP .PP
\f[CB]Compiled\f[R]: Number of compilation tasks performed. \f[V]Compiled\f[R]: Number of compilation tasks performed.
.PP .PP
\f[CB]Failed\f[R]: Number of compilations tasks failed. \f[V]Failed\f[R]: Number of compilations tasks failed.
.PP .PP
\f[CB]Invalid\f[R]: Number of compilation tasks that were invalidated. \f[V]Invalid\f[R]: Number of compilation tasks that were invalidated.
.PP .PP
\f[CB]Time\f[R]: Time spent performing compilation tasks. \f[V]Time\f[R]: Time spent performing compilation tasks.
.PP .PP
\f[CB]FailedType\f[R]: Compile type of the last failed compilation. \f[V]FailedType\f[R]: Compile type of the last failed compilation.
.PP .PP
\f[CB]FailedMethod\f[R]: Class name and method of the last failed \f[V]FailedMethod\f[R]: Class name and method of the last failed
compilation. compilation.
.RE .RE
.TP .TP
.B \f[CB]\-gc\f[R] \f[I]option\f[R] \f[V]-gc\f[R] \f[I]option\f[R]
Garbage collected heap statistics. Garbage collected heap statistics.
.RS .RS
.PP .PP
\f[CB]S0C\f[R]: Current survivor space 0 capacity (KB). \f[V]S0C\f[R]: Current survivor space 0 capacity (KB).
.PP .PP
\f[CB]S1C\f[R]: Current survivor space 1 capacity (KB). \f[V]S1C\f[R]: Current survivor space 1 capacity (KB).
.PP .PP
\f[CB]S0U\f[R]: Survivor space 0 utilization (KB). \f[V]S0U\f[R]: Survivor space 0 utilization (KB).
.PP .PP
\f[CB]S1U\f[R]: Survivor space 1 utilization (KB). \f[V]S1U\f[R]: Survivor space 1 utilization (KB).
.PP .PP
\f[CB]EC\f[R]: Current eden space capacity (KB). \f[V]EC\f[R]: Current eden space capacity (KB).
.PP .PP
\f[CB]EU\f[R]: Eden space utilization (KB). \f[V]EU\f[R]: Eden space utilization (KB).
.PP .PP
\f[CB]OC\f[R]: Current old space capacity (KB). \f[V]OC\f[R]: Current old space capacity (KB).
.PP .PP
\f[CB]OU\f[R]: Old space utilization (KB). \f[V]OU\f[R]: Old space utilization (KB).
.PP .PP
\f[CB]MC\f[R]: Metaspace Committed Size (KB). \f[V]MC\f[R]: Metaspace Committed Size (KB).
.PP .PP
\f[CB]MU\f[R]: Metaspace utilization (KB). \f[V]MU\f[R]: Metaspace utilization (KB).
.PP .PP
\f[CB]CCSC\f[R]: Compressed class committed size (KB). \f[V]CCSC\f[R]: Compressed class committed size (KB).
.PP .PP
\f[CB]CCSU\f[R]: Compressed class space used (KB). \f[V]CCSU\f[R]: Compressed class space used (KB).
.PP .PP
\f[CB]YGC\f[R]: Number of young generation garbage collection (GC) events. \f[V]YGC\f[R]: Number of young generation garbage collection (GC)
events.
.PP .PP
\f[CB]YGCT\f[R]: Young generation garbage collection time. \f[V]YGCT\f[R]: Young generation garbage collection time.
.PP .PP
\f[CB]FGC\f[R]: Number of full GC events. \f[V]FGC\f[R]: Number of full GC events.
.PP .PP
\f[CB]FGCT\f[R]: Full garbage collection time. \f[V]FGCT\f[R]: Full garbage collection time.
.PP .PP
\f[CB]GCT\f[R]: Total garbage collection time. \f[V]GCT\f[R]: Total garbage collection time.
.RE .RE
.TP .TP
.B \f[CB]\-gccapacity\f[R] \f[I]option\f[R] \f[V]-gccapacity\f[R] \f[I]option\f[R]
Memory pool generation and space capacities. Memory pool generation and space capacities.
.RS .RS
.PP .PP
\f[CB]NGCMN\f[R]: Minimum new generation capacity (KB). \f[V]NGCMN\f[R]: Minimum new generation capacity (KB).
.PP .PP
\f[CB]NGCMX\f[R]: Maximum new generation capacity (KB). \f[V]NGCMX\f[R]: Maximum new generation capacity (KB).
.PP .PP
\f[CB]NGC\f[R]: Current new generation capacity (KB). \f[V]NGC\f[R]: Current new generation capacity (KB).
.PP .PP
\f[CB]S0C\f[R]: Current survivor space 0 capacity (KB). \f[V]S0C\f[R]: Current survivor space 0 capacity (KB).
.PP .PP
\f[CB]S1C\f[R]: Current survivor space 1 capacity (KB). \f[V]S1C\f[R]: Current survivor space 1 capacity (KB).
.PP .PP
\f[CB]EC\f[R]: Current eden space capacity (KB). \f[V]EC\f[R]: Current eden space capacity (KB).
.PP .PP
\f[CB]OGCMN\f[R]: Minimum old generation capacity (KB). \f[V]OGCMN\f[R]: Minimum old generation capacity (KB).
.PP .PP
\f[CB]OGCMX\f[R]: Maximum old generation capacity (KB). \f[V]OGCMX\f[R]: Maximum old generation capacity (KB).
.PP .PP
\f[CB]OGC\f[R]: Current old generation capacity (KB). \f[V]OGC\f[R]: Current old generation capacity (KB).
.PP .PP
\f[CB]OC\f[R]: Current old space capacity (KB). \f[V]OC\f[R]: Current old space capacity (KB).
.PP .PP
\f[CB]MCMN\f[R]: Minimum metaspace capacity (KB). \f[V]MCMN\f[R]: Minimum metaspace capacity (KB).
.PP .PP
\f[CB]MCMX\f[R]: Maximum metaspace capacity (KB). \f[V]MCMX\f[R]: Maximum metaspace capacity (KB).
.PP .PP
\f[CB]MC\f[R]: Metaspace Committed Size (KB). \f[V]MC\f[R]: Metaspace Committed Size (KB).
.PP .PP
\f[CB]CCSMN\f[R]: Compressed class space minimum capacity (KB). \f[V]CCSMN\f[R]: Compressed class space minimum capacity (KB).
.PP .PP
\f[CB]CCSMX\f[R]: Compressed class space maximum capacity (KB). \f[V]CCSMX\f[R]: Compressed class space maximum capacity (KB).
.PP .PP
\f[CB]CCSC\f[R]: Compressed class committed size (KB). \f[V]CCSC\f[R]: Compressed class committed size (KB).
.PP .PP
\f[CB]YGC\f[R]: Number of young generation GC events. \f[V]YGC\f[R]: Number of young generation GC events.
.PP .PP
\f[CB]FGC\f[R]: Number of full GC events. \f[V]FGC\f[R]: Number of full GC events.
.RE .RE
.TP .TP
.B \f[CB]\-gccause\f[R] \f[I]option\f[R] \f[V]-gccause\f[R] \f[I]option\f[R]
This option displays the same summary of garbage collection statistics This option displays the same summary of garbage collection statistics
as the \f[CB]\-gcutil\f[R] option, but includes the causes of the last as the \f[V]-gcutil\f[R] option, but includes the causes of the last
garbage collection event and (when applicable), the current garbage garbage collection event and (when applicable), the current garbage
collection event. collection event.
In addition to the columns listed for \f[CB]\-gcutil\f[R], this option In addition to the columns listed for \f[V]-gcutil\f[R], this option
adds the following columns: adds the following columns:
.RS .RS
.PP .PP
\f[CB]LGCC\f[R]: Cause of last garbage collection \f[V]LGCC\f[R]: Cause of last garbage collection
.PP .PP
\f[CB]GCC\f[R]: Cause of current garbage collection \f[V]GCC\f[R]: Cause of current garbage collection
.RE .RE
.TP .TP
.B \f[CB]\-gcnew\f[R] \f[I]option\f[R] \f[V]-gcnew\f[R] \f[I]option\f[R]
New generation statistics. New generation statistics.
.RS .RS
.PP .PP
\f[CB]S0C\f[R]: Current survivor space 0 capacity (KB). \f[V]S0C\f[R]: Current survivor space 0 capacity (KB).
.PP .PP
\f[CB]S1C\f[R]: Current survivor space 1 capacity (KB). \f[V]S1C\f[R]: Current survivor space 1 capacity (KB).
.PP .PP
\f[CB]S0U\f[R]: Survivor space 0 utilization (KB). \f[V]S0U\f[R]: Survivor space 0 utilization (KB).
.PP .PP
\f[CB]S1U\f[R]: Survivor space 1 utilization (KB). \f[V]S1U\f[R]: Survivor space 1 utilization (KB).
.PP .PP
\f[CB]TT\f[R]: Tenuring threshold. \f[V]TT\f[R]: Tenuring threshold.
.PP .PP
\f[CB]MTT\f[R]: Maximum tenuring threshold. \f[V]MTT\f[R]: Maximum tenuring threshold.
.PP .PP
\f[CB]DSS\f[R]: Desired survivor size (KB). \f[V]DSS\f[R]: Desired survivor size (KB).
.PP .PP
\f[CB]EC\f[R]: Current eden space capacity (KB). \f[V]EC\f[R]: Current eden space capacity (KB).
.PP .PP
\f[CB]EU\f[R]: Eden space utilization (KB). \f[V]EU\f[R]: Eden space utilization (KB).
.PP .PP
\f[CB]YGC\f[R]: Number of young generation GC events. \f[V]YGC\f[R]: Number of young generation GC events.
.PP .PP
\f[CB]YGCT\f[R]: Young generation garbage collection time. \f[V]YGCT\f[R]: Young generation garbage collection time.
.RE .RE
.TP .TP
.B \f[CB]\-gcnewcapacity\f[R] \f[I]option\f[R] \f[V]-gcnewcapacity\f[R] \f[I]option\f[R]
New generation space size statistics. New generation space size statistics.
.RS .RS
.PP .PP
\f[CB]NGCMN\f[R]: Minimum new generation capacity (KB). \f[V]NGCMN\f[R]: Minimum new generation capacity (KB).
.PP .PP
\f[CB]NGCMX\f[R]: Maximum new generation capacity (KB). \f[V]NGCMX\f[R]: Maximum new generation capacity (KB).
.PP .PP
\f[CB]NGC\f[R]: Current new generation capacity (KB). \f[V]NGC\f[R]: Current new generation capacity (KB).
.PP .PP
\f[CB]S0CMX\f[R]: Maximum survivor space 0 capacity (KB). \f[V]S0CMX\f[R]: Maximum survivor space 0 capacity (KB).
.PP .PP
\f[CB]S0C\f[R]: Current survivor space 0 capacity (KB). \f[V]S0C\f[R]: Current survivor space 0 capacity (KB).
.PP .PP
\f[CB]S1CMX\f[R]: Maximum survivor space 1 capacity (KB). \f[V]S1CMX\f[R]: Maximum survivor space 1 capacity (KB).
.PP .PP
\f[CB]S1C\f[R]: Current survivor space 1 capacity (KB). \f[V]S1C\f[R]: Current survivor space 1 capacity (KB).
.PP .PP
\f[CB]ECMX\f[R]: Maximum eden space capacity (KB). \f[V]ECMX\f[R]: Maximum eden space capacity (KB).
.PP .PP
\f[CB]EC\f[R]: Current eden space capacity (KB). \f[V]EC\f[R]: Current eden space capacity (KB).
.PP .PP
\f[CB]YGC\f[R]: Number of young generation GC events. \f[V]YGC\f[R]: Number of young generation GC events.
.PP .PP
\f[CB]FGC\f[R]: Number of full GC events. \f[V]FGC\f[R]: Number of full GC events.
.RE .RE
.TP .TP
.B \f[CB]\-gcold\f[R] \f[I]option\f[R] \f[V]-gcold\f[R] \f[I]option\f[R]
Old generation size statistics. Old generation size statistics.
.RS .RS
.PP .PP
\f[CB]MC\f[R]: Metaspace Committed Size (KB). \f[V]MC\f[R]: Metaspace Committed Size (KB).
.PP .PP
\f[CB]MU\f[R]: Metaspace utilization (KB). \f[V]MU\f[R]: Metaspace utilization (KB).
.PP .PP
\f[CB]CCSC\f[R]: Compressed class committed size (KB). \f[V]CCSC\f[R]: Compressed class committed size (KB).
.PP .PP
\f[CB]CCSU\f[R]: Compressed class space used (KB). \f[V]CCSU\f[R]: Compressed class space used (KB).
.PP .PP
\f[CB]OC\f[R]: Current old space capacity (KB). \f[V]OC\f[R]: Current old space capacity (KB).
.PP .PP
\f[CB]OU\f[R]: Old space utilization (KB). \f[V]OU\f[R]: Old space utilization (KB).
.PP .PP
\f[CB]YGC\f[R]: Number of young generation GC events. \f[V]YGC\f[R]: Number of young generation GC events.
.PP .PP
\f[CB]FGC\f[R]: Number of full GC events. \f[V]FGC\f[R]: Number of full GC events.
.PP .PP
\f[CB]FGCT\f[R]: Full garbage collection time. \f[V]FGCT\f[R]: Full garbage collection time.
.PP .PP
\f[CB]GCT\f[R]: Total garbage collection time. \f[V]GCT\f[R]: Total garbage collection time.
.RE .RE
.TP .TP
.B \f[CB]\-gcoldcapacity\f[R] \f[I]option\f[R] \f[V]-gcoldcapacity\f[R] \f[I]option\f[R]
Old generation statistics. Old generation statistics.
.RS .RS
.PP .PP
\f[CB]OGCMN\f[R]: Minimum old generation capacity (KB). \f[V]OGCMN\f[R]: Minimum old generation capacity (KB).
.PP .PP
\f[CB]OGCMX\f[R]: Maximum old generation capacity (KB). \f[V]OGCMX\f[R]: Maximum old generation capacity (KB).
.PP .PP
\f[CB]OGC\f[R]: Current old generation capacity (KB). \f[V]OGC\f[R]: Current old generation capacity (KB).
.PP .PP
\f[CB]OC\f[R]: Current old space capacity (KB). \f[V]OC\f[R]: Current old space capacity (KB).
.PP .PP
\f[CB]YGC\f[R]: Number of young generation GC events. \f[V]YGC\f[R]: Number of young generation GC events.
.PP .PP
\f[CB]FGC\f[R]: Number of full GC events. \f[V]FGC\f[R]: Number of full GC events.
.PP .PP
\f[CB]FGCT\f[R]: Full garbage collection time. \f[V]FGCT\f[R]: Full garbage collection time.
.PP .PP
\f[CB]GCT\f[R]: Total garbage collection time. \f[V]GCT\f[R]: Total garbage collection time.
.RE .RE
.TP .TP
.B \f[CB]\-gcmetacapacity\f[R] \f[I]option\f[R] \f[V]-gcmetacapacity\f[R] \f[I]option\f[R]
Metaspace size statistics. Metaspace size statistics.
.RS .RS
.PP .PP
\f[CB]MCMN\f[R]: Minimum metaspace capacity (KB). \f[V]MCMN\f[R]: Minimum metaspace capacity (KB).
.PP .PP
\f[CB]MCMX\f[R]: Maximum metaspace capacity (KB). \f[V]MCMX\f[R]: Maximum metaspace capacity (KB).
.PP .PP
\f[CB]MC\f[R]: Metaspace Committed Size (KB). \f[V]MC\f[R]: Metaspace Committed Size (KB).
.PP .PP
\f[CB]CCSMN\f[R]: Compressed class space minimum capacity (KB). \f[V]CCSMN\f[R]: Compressed class space minimum capacity (KB).
.PP .PP
\f[CB]CCSMX\f[R]: Compressed class space maximum capacity (KB). \f[V]CCSMX\f[R]: Compressed class space maximum capacity (KB).
.PP .PP
\f[CB]YGC\f[R]: Number of young generation GC events. \f[V]YGC\f[R]: Number of young generation GC events.
.PP .PP
\f[CB]FGC\f[R]: Number of full GC events. \f[V]FGC\f[R]: Number of full GC events.
.PP .PP
\f[CB]FGCT\f[R]: Full garbage collection time. \f[V]FGCT\f[R]: Full garbage collection time.
.PP .PP
\f[CB]GCT\f[R]: Total garbage collection time. \f[V]GCT\f[R]: Total garbage collection time.
.RE .RE
.TP .TP
.B \f[CB]\-gcutil\f[R] \f[I]option\f[R] \f[V]-gcutil\f[R] \f[I]option\f[R]
Summary of garbage collection statistics. Summary of garbage collection statistics.
.RS .RS
.PP .PP
\f[CB]S0\f[R]: Survivor space 0 utilization as a percentage of the \f[V]S0\f[R]: Survivor space 0 utilization as a percentage of the
space\[aq]s current capacity. space\[aq]s current capacity.
.PP .PP
\f[CB]S1\f[R]: Survivor space 1 utilization as a percentage of the \f[V]S1\f[R]: Survivor space 1 utilization as a percentage of the
space\[aq]s current capacity. space\[aq]s current capacity.
.PP .PP
\f[CB]E\f[R]: Eden space utilization as a percentage of the space\[aq]s \f[V]E\f[R]: Eden space utilization as a percentage of the space\[aq]s
current capacity. current capacity.
.PP .PP
\f[CB]O\f[R]: Old space utilization as a percentage of the space\[aq]s \f[V]O\f[R]: Old space utilization as a percentage of the space\[aq]s
current capacity. current capacity.
.PP .PP
\f[CB]M\f[R]: Metaspace utilization as a percentage of the space\[aq]s \f[V]M\f[R]: Metaspace utilization as a percentage of the space\[aq]s
current capacity. current capacity.
.PP .PP
\f[CB]CCS\f[R]: Compressed class space utilization as a percentage. \f[V]CCS\f[R]: Compressed class space utilization as a percentage.
.PP .PP
\f[CB]YGC\f[R]: Number of young generation GC events. \f[V]YGC\f[R]: Number of young generation GC events.
.PP .PP
\f[CB]YGCT\f[R]: Young generation garbage collection time. \f[V]YGCT\f[R]: Young generation garbage collection time.
.PP .PP
\f[CB]FGC\f[R]: Number of full GC events. \f[V]FGC\f[R]: Number of full GC events.
.PP .PP
\f[CB]FGCT\f[R]: Full garbage collection time. \f[V]FGCT\f[R]: Full garbage collection time.
.PP .PP
\f[CB]GCT\f[R]: Total garbage collection time. \f[V]GCT\f[R]: Total garbage collection time.
.RE .RE
.TP .TP
.B \f[CB]\-printcompilation\f[R] \f[I]option\f[R] \f[V]-printcompilation\f[R] \f[I]option\f[R]
Java HotSpot VM compiler method statistics. Java HotSpot VM compiler method statistics.
.RS .RS
.PP .PP
\f[CB]Compiled\f[R]: Number of compilation tasks performed by the most \f[V]Compiled\f[R]: Number of compilation tasks performed by the most
recently compiled method. recently compiled method.
.PP .PP
\f[CB]Size\f[R]: Number of bytes of byte code of the most recently \f[V]Size\f[R]: Number of bytes of byte code of the most recently
compiled method. compiled method.
.PP .PP
\f[CB]Type\f[R]: Compilation type of the most recently compiled method. \f[V]Type\f[R]: Compilation type of the most recently compiled method.
.PP .PP
\f[CB]Method\f[R]: Class name and method name identifying the most \f[V]Method\f[R]: Class name and method name identifying the most
recently compiled method. recently compiled method.
Class name uses a slash (/) instead of a dot (.) as a name space Class name uses a slash (/) instead of a dot (.)
separator. as a name space separator.
The method name is the method within the specified class. The method name is the method within the specified class.
The format for these two fields is consistent with the HotSpot The format for these two fields is consistent with the HotSpot
\f[CB]\-XX:+PrintCompilation\f[R] option. \f[V]-XX:+PrintCompilation\f[R] option.
.RE .RE
.SH VIRTUAL MACHINE IDENTIFIER .SH VIRTUAL MACHINE IDENTIFIER
.PP .PP
The syntax of the \f[CB]vmid\f[R] string corresponds to the syntax of a The syntax of the \f[V]vmid\f[R] string corresponds to the syntax of a
URI: URI:
.RS .RS
.PP .PP
[\f[I]protocol\f[R]\f[CB]:\f[R]][\f[CB]//\f[R]]\f[I]lvmid\f[R][\f[CB]\@\f[R]\f[I]hostname\f[R][\f[CB]:\f[R]\f[I]port\f[R]][\f[CB]/\f[R]\f[I]servername\f[R]] [\f[I]protocol\f[R]\f[V]:\f[R]][\f[V]//\f[R]]\f[I]lvmid\f[R][\f[V]\[at]\f[R]\f[I]hostname\f[R][\f[V]:\f[R]\f[I]port\f[R]][\f[V]/\f[R]\f[I]servername\f[R]]
.RE .RE
.PP .PP
The syntax of the \f[CB]vmid\f[R] string corresponds to the syntax of a The syntax of the \f[V]vmid\f[R] string corresponds to the syntax of a
URI. URI.
The \f[CB]vmid\f[R] string can vary from a simple integer that represents The \f[V]vmid\f[R] string can vary from a simple integer that represents
a local JVM to a more complex construction that specifies a a local JVM to a more complex construction that specifies a
communications protocol, port number, and other implementation\-specific communications protocol, port number, and other implementation-specific
values. values.
.TP .TP
.B \f[I]protocol\f[R] \f[I]protocol\f[R]
The communications protocol. The communications protocol.
If the \f[I]protocol\f[R] value is omitted and a host name isn\[aq]t If the \f[I]protocol\f[R] value is omitted and a host name isn\[aq]t
specified, then the default protocol is a platform\-specific optimized specified, then the default protocol is a platform-specific optimized
local protocol. local protocol.
If the \f[I]protocol\f[R] value is omitted and a host name is specified, If the \f[I]protocol\f[R] value is omitted and a host name is specified,
then the default protocol is \f[CB]rmi\f[R]. then the default protocol is \f[V]rmi\f[R].
.RS
.RE
.TP .TP
.B \f[I]lvmid\f[R] \f[I]lvmid\f[R]
The local virtual machine identifier for the target JVM. The local virtual machine identifier for the target JVM.
The \f[I]lvmid\f[R] is a platform\-specific value that uniquely The \f[I]lvmid\f[R] is a platform-specific value that uniquely
identifies a JVM on a system. identifies a JVM on a system.
The \f[I]lvmid\f[R] is the only required component of a virtual machine The \f[I]lvmid\f[R] is the only required component of a virtual machine
identifier. identifier.
The \f[I]lvmid\f[R] is typically, but not necessarily, the operating The \f[I]lvmid\f[R] is typically, but not necessarily, the operating
system\[aq]s process identifier for the target JVM process. system\[aq]s process identifier for the target JVM process.
You can use the \f[CB]jps\f[R] command to determine the \f[I]lvmid\f[R] You can use the \f[V]jps\f[R] command to determine the \f[I]lvmid\f[R]
provided the JVM processes is not running in a separate docker instance. provided the JVM processes is not running in a separate docker instance.
You can also determine the \f[I]lvmid\f[R] on Linux and OS X platforms You can also determine the \f[I]lvmid\f[R] on Linux and OS X platforms
with the \f[CB]ps\f[R] command, and on Windows with the Windows Task with the \f[V]ps\f[R] command, and on Windows with the Windows Task
Manager. Manager.
.RS
.RE
.TP .TP
.B \f[I]hostname\f[R] \f[I]hostname\f[R]
A host name or IP address that indicates the target host. A host name or IP address that indicates the target host.
If the \f[I]hostname\f[R] value is omitted, then the target host is the If the \f[I]hostname\f[R] value is omitted, then the target host is the
local host. local host.
.RS
.RE
.TP .TP
.B \f[I]port\f[R] \f[I]port\f[R]
The default port for communicating with the remote server. The default port for communicating with the remote server.
If the \f[I]hostname\f[R] value is omitted or the \f[I]protocol\f[R] value If the \f[I]hostname\f[R] value is omitted or the \f[I]protocol\f[R]
specifies an optimized, local protocol, then the \f[I]port\f[R] value is value specifies an optimized, local protocol, then the \f[I]port\f[R]
ignored. value is ignored.
Otherwise, treatment of the \f[I]port\f[R] parameter is Otherwise, treatment of the \f[I]port\f[R] parameter is
implementation\-specific. implementation-specific.
For the default \f[CB]rmi\f[R] protocol, the port value indicates the port For the default \f[V]rmi\f[R] protocol, the port value indicates the
number for the \f[CB]rmiregistry\f[R] on the remote host. port number for the \f[V]rmiregistry\f[R] on the remote host.
If the \f[I]port\f[R] value is omitted and the \f[I]protocol\f[R] value If the \f[I]port\f[R] value is omitted and the \f[I]protocol\f[R] value
indicates \f[CB]rmi\f[R], then the default rmiregistry port (1099) is indicates \f[V]rmi\f[R], then the default rmiregistry port (1099) is
used. used.
.RS
.RE
.TP .TP
.B \f[I]servername\f[R] \f[I]servername\f[R]
The treatment of the \f[I]servername\f[R] parameter depends on The treatment of the \f[I]servername\f[R] parameter depends on
implementation. implementation.
For the optimized local protocol, this field is ignored. For the optimized local protocol, this field is ignored.
For the \f[CB]rmi\f[R] protocol, it represents the name of the RMI remote For the \f[V]rmi\f[R] protocol, it represents the name of the RMI remote
object on the remote host. object on the remote host.
.RS
.RE
.SH EXAMPLES .SH EXAMPLES
.PP .PP
This section presents some examples of monitoring a local JVM with an This section presents some examples of monitoring a local JVM with an
@ -597,7 +584,7 @@ This section presents some examples of monitoring a local JVM with an
.PP .PP
This example attaches to lvmid 21891 and takes 7 samples at 250 This example attaches to lvmid 21891 and takes 7 samples at 250
millisecond intervals and displays the output as specified by the millisecond intervals and displays the output as specified by the
\f[CB]\-gcutil\f[R] option. \f[V]-gcutil\f[R] option.
.PP .PP
The output of this example shows that a young generation collection The output of this example shows that a young generation collection
occurred between the third and fourth sample. occurred between the third and fourth sample.
@ -609,23 +596,23 @@ this collection it\[aq]s 91.03% utilized.
.IP .IP
.nf .nf
\f[CB] \f[CB]
jstat\ \-gcutil\ 21891\ 250\ 7 jstat -gcutil 21891 250 7
\ \ S0\ \ \ \ \ S1\ \ \ \ \ E\ \ \ \ \ \ O\ \ \ \ \ \ M\ \ \ \ \ CCS\ \ \ \ YGC\ \ \ \ \ YGCT\ \ \ \ FGC\ \ \ \ FGCT\ \ \ \ \ GCT S0 S1 E O M CCS YGC YGCT FGC FGCT GCT
\ \ 0.00\ \ 97.02\ \ 70.31\ \ 66.80\ \ 95.52\ \ 89.14\ \ \ \ \ \ 7\ \ \ \ 0.300\ \ \ \ \ 0\ \ \ \ 0.000\ \ \ \ 0.300 0.00 97.02 70.31 66.80 95.52 89.14 7 0.300 0 0.000 0.300
\ \ 0.00\ \ 97.02\ \ 86.23\ \ 66.80\ \ 95.52\ \ 89.14\ \ \ \ \ \ 7\ \ \ \ 0.300\ \ \ \ \ 0\ \ \ \ 0.000\ \ \ \ 0.300 0.00 97.02 86.23 66.80 95.52 89.14 7 0.300 0 0.000 0.300
\ \ 0.00\ \ 97.02\ \ 96.53\ \ 66.80\ \ 95.52\ \ 89.14\ \ \ \ \ \ 7\ \ \ \ 0.300\ \ \ \ \ 0\ \ \ \ 0.000\ \ \ \ 0.300 0.00 97.02 96.53 66.80 95.52 89.14 7 0.300 0 0.000 0.300
\ 91.03\ \ \ 0.00\ \ \ 1.98\ \ 68.19\ \ 95.89\ \ 91.24\ \ \ \ \ \ 8\ \ \ \ 0.378\ \ \ \ \ 0\ \ \ \ 0.000\ \ \ \ 0.378 91.03 0.00 1.98 68.19 95.89 91.24 8 0.378 0 0.000 0.378
\ 91.03\ \ \ 0.00\ \ 15.82\ \ 68.19\ \ 95.89\ \ 91.24\ \ \ \ \ \ 8\ \ \ \ 0.378\ \ \ \ \ 0\ \ \ \ 0.000\ \ \ \ 0.378 91.03 0.00 15.82 68.19 95.89 91.24 8 0.378 0 0.000 0.378
\ 91.03\ \ \ 0.00\ \ 17.80\ \ 68.19\ \ 95.89\ \ 91.24\ \ \ \ \ \ 8\ \ \ \ 0.378\ \ \ \ \ 0\ \ \ \ 0.000\ \ \ \ 0.378 91.03 0.00 17.80 68.19 95.89 91.24 8 0.378 0 0.000 0.378
\ 91.03\ \ \ 0.00\ \ 17.80\ \ 68.19\ \ 95.89\ \ 91.24\ \ \ \ \ \ 8\ \ \ \ 0.378\ \ \ \ \ 0\ \ \ \ 0.000\ \ \ \ 0.378 91.03 0.00 17.80 68.19 95.89 91.24 8 0.378 0 0.000 0.378
\f[R] \f[R]
.fi .fi
.SH REPEAT THE COLUMN HEADER STRING .SH REPEAT THE COLUMN HEADER STRING
.PP .PP
This example attaches to lvmid 21891 and takes samples at 250 This example attaches to lvmid 21891 and takes samples at 250
millisecond intervals and displays the output as specified by millisecond intervals and displays the output as specified by
\f[CB]\-gcnew\f[R] option. \f[V]-gcnew\f[R] option.
In addition, it uses the \f[CB]\-h3\f[R] option to output the column In addition, it uses the \f[V]-h3\f[R] option to output the column
header after every 3 lines of data. header after every 3 lines of data.
.PP .PP
In addition to showing the repeating header string, this example shows In addition to showing the repeating header string, this example shows
@ -642,61 +629,61 @@ threshold to 31.
.IP .IP
.nf .nf
\f[CB] \f[CB]
jstat\ \-gcnew\ \-h3\ 21891\ 250 jstat -gcnew -h3 21891 250
\ S0C\ \ \ \ S1C\ \ \ \ S0U\ \ \ \ S1U\ \ \ TT\ MTT\ \ DSS\ \ \ \ \ \ EC\ \ \ \ \ \ \ EU\ \ \ \ \ YGC\ \ \ \ \ YGCT S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
\ \ 64.0\ \ \ 64.0\ \ \ \ 0.0\ \ \ 31.7\ 31\ \ 31\ \ \ 32.0\ \ \ \ 512.0\ \ \ \ 178.6\ \ \ \ 249\ \ \ \ 0.203 64.0 64.0 0.0 31.7 31 31 32.0 512.0 178.6 249 0.203
\ \ 64.0\ \ \ 64.0\ \ \ \ 0.0\ \ \ 31.7\ 31\ \ 31\ \ \ 32.0\ \ \ \ 512.0\ \ \ \ 355.5\ \ \ \ 249\ \ \ \ 0.203 64.0 64.0 0.0 31.7 31 31 32.0 512.0 355.5 249 0.203
\ \ 64.0\ \ \ 64.0\ \ \ 35.4\ \ \ \ 0.0\ \ 2\ \ 31\ \ \ 32.0\ \ \ \ 512.0\ \ \ \ \ 21.9\ \ \ \ 250\ \ \ \ 0.204 64.0 64.0 35.4 0.0 2 31 32.0 512.0 21.9 250 0.204
\ S0C\ \ \ \ S1C\ \ \ \ S0U\ \ \ \ S1U\ \ \ TT\ MTT\ \ DSS\ \ \ \ \ \ EC\ \ \ \ \ \ \ EU\ \ \ \ \ YGC\ \ \ \ \ YGCT S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
\ \ 64.0\ \ \ 64.0\ \ \ 35.4\ \ \ \ 0.0\ \ 2\ \ 31\ \ \ 32.0\ \ \ \ 512.0\ \ \ \ 245.9\ \ \ \ 250\ \ \ \ 0.204 64.0 64.0 35.4 0.0 2 31 32.0 512.0 245.9 250 0.204
\ \ 64.0\ \ \ 64.0\ \ \ 35.4\ \ \ \ 0.0\ \ 2\ \ 31\ \ \ 32.0\ \ \ \ 512.0\ \ \ \ 421.1\ \ \ \ 250\ \ \ \ 0.204 64.0 64.0 35.4 0.0 2 31 32.0 512.0 421.1 250 0.204
\ \ 64.0\ \ \ 64.0\ \ \ \ 0.0\ \ \ 19.0\ 31\ \ 31\ \ \ 32.0\ \ \ \ 512.0\ \ \ \ \ 84.4\ \ \ \ 251\ \ \ \ 0.204 64.0 64.0 0.0 19.0 31 31 32.0 512.0 84.4 251 0.204
\ S0C\ \ \ \ S1C\ \ \ \ S0U\ \ \ \ S1U\ \ \ TT\ MTT\ \ DSS\ \ \ \ \ \ EC\ \ \ \ \ \ \ EU\ \ \ \ \ YGC\ \ \ \ \ YGCT S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
\ \ 64.0\ \ \ 64.0\ \ \ \ 0.0\ \ \ 19.0\ 31\ \ 31\ \ \ 32.0\ \ \ \ 512.0\ \ \ \ 306.7\ \ \ \ 251\ \ \ \ 0.204 64.0 64.0 0.0 19.0 31 31 32.0 512.0 306.7 251 0.204
\f[R] \f[R]
.fi .fi
.SH INCLUDE A TIME STAMP FOR EACH SAMPLE .SH INCLUDE A TIME STAMP FOR EACH SAMPLE
.PP .PP
This example attaches to lvmid 21891 and takes 3 samples at 250 This example attaches to lvmid 21891 and takes 3 samples at 250
millisecond intervals. millisecond intervals.
The \f[CB]\-t\f[R] option is used to generate a time stamp for each sample The \f[V]-t\f[R] option is used to generate a time stamp for each sample
in the first column. in the first column.
.PP .PP
The Timestamp column reports the elapsed time in seconds since the start The Timestamp column reports the elapsed time in seconds since the start
of the target JVM. of the target JVM.
In addition, the \f[CB]\-gcoldcapacity\f[R] output shows the old In addition, the \f[V]-gcoldcapacity\f[R] output shows the old
generation capacity (OGC) and the old space capacity (OC) increasing as generation capacity (OGC) and the old space capacity (OC) increasing as
the heap expands to meet allocation or promotion demands. the heap expands to meet allocation or promotion demands.
The old generation capacity (OGC) has grown from 11,696 KB to 13,820 KB The old generation capacity (OGC) has grown from 11,696 KB to 13,820 KB
after the eighty\-first full garbage collection (FGC). after the eighty-first full garbage collection (FGC).
The maximum capacity of the generation (and space) is 60,544 KB (OGCMX), The maximum capacity of the generation (and space) is 60,544 KB (OGCMX),
so it still has room to expand. so it still has room to expand.
.IP .IP
.nf .nf
\f[CB] \f[CB]
Timestamp\ \ \ \ \ \ OGCMN\ \ \ \ OGCMX\ \ \ \ \ OGC\ \ \ \ \ \ \ OC\ \ \ \ \ \ \ YGC\ \ \ FGC\ \ \ \ FGCT\ \ \ \ GCT Timestamp OGCMN OGCMX OGC OC YGC FGC FGCT GCT
\ \ \ \ \ \ \ \ \ \ 150.1\ \ \ 1408.0\ \ 60544.0\ \ 11696.0\ \ 11696.0\ \ \ 194\ \ \ \ 80\ \ \ \ 2.874\ \ \ 3.799 150.1 1408.0 60544.0 11696.0 11696.0 194 80 2.874 3.799
\ \ \ \ \ \ \ \ \ \ 150.4\ \ \ 1408.0\ \ 60544.0\ \ 13820.0\ \ 13820.0\ \ \ 194\ \ \ \ 81\ \ \ \ 2.938\ \ \ 3.863 150.4 1408.0 60544.0 13820.0 13820.0 194 81 2.938 3.863
\ \ \ \ \ \ \ \ \ \ 150.7\ \ \ 1408.0\ \ 60544.0\ \ 13820.0\ \ 13820.0\ \ \ 194\ \ \ \ 81\ \ \ \ 2.938\ \ \ 3.863 150.7 1408.0 60544.0 13820.0 13820.0 194 81 2.938 3.863
\f[R] \f[R]
.fi .fi
.SH MONITOR INSTRUMENTATION FOR A REMOTE JVM .SH MONITOR INSTRUMENTATION FOR A REMOTE JVM
.PP .PP
This example attaches to lvmid 40496 on the system named This example attaches to lvmid 40496 on the system named
\f[CB]remote.domain\f[R] using the \f[CB]\-gcutil\f[R] option, with samples \f[V]remote.domain\f[R] using the \f[V]-gcutil\f[R] option, with samples
taken every second indefinitely. taken every second indefinitely.
.PP .PP
The lvmid is combined with the name of the remote host to construct a The lvmid is combined with the name of the remote host to construct a
vmid of \f[CB]40496\@remote.domain\f[R]. vmid of \f[V]40496\[at]remote.domain\f[R].
This vmid results in the use of the \f[CB]rmi\f[R] protocol to communicate This vmid results in the use of the \f[V]rmi\f[R] protocol to
to the default \f[CB]jstatd\f[R] server on the remote host. communicate to the default \f[V]jstatd\f[R] server on the remote host.
The \f[CB]jstatd\f[R] server is located using the \f[CB]rmiregistry\f[R] The \f[V]jstatd\f[R] server is located using the \f[V]rmiregistry\f[R]
command on \f[CB]remote.domain\f[R] that\[aq]s bound to the default port command on \f[V]remote.domain\f[R] that\[aq]s bound to the default port
of the \f[CB]rmiregistry\f[R] command (port 1099). of the \f[V]rmiregistry\f[R] command (port 1099).
.IP .IP
.nf .nf
\f[CB] \f[CB]
jstat\ \-gcutil\ 40496\@remote.domain\ 1000 jstat -gcutil 40496\[at]remote.domain 1000
\&...\ output\ omitted \&... output omitted
\f[R] \f[R]
.fi .fi

View file

@ -19,84 +19,86 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JCONSOLE" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JCONSOLE" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jconsole \- start a graphical console to monitor and manage Java jconsole - start a graphical console to monitor and manage Java
applications applications
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jconsole\f[R] [\f[CB]\-interval=\f[R]\f[I]n\f[R]] [\f[CB]\-notile\f[R]] \f[V]jconsole\f[R] [\f[V]-interval=\f[R]\f[I]n\f[R]] [\f[V]-notile\f[R]]
[\f[CB]\-plugin\f[R] \f[I]path\f[R]] [\f[CB]\-version\f[R]] [\f[V]-plugin\f[R] \f[I]path\f[R]] [\f[V]-version\f[R]]
[\f[I]connection\f[R] ... [\f[I]connection\f[R] ...
] [\f[CB]\-J\f[R]\f[I]input_arguments\f[R]] ] [\f[V]-J\f[R]\f[I]input_arguments\f[R]]
.PP .PP
\f[CB]jconsole\f[R] \f[CB]\-help\f[R] \f[V]jconsole\f[R] \f[V]-help\f[R]
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \f[CB]\-interval\f[R] \f[V]-interval\f[R]
Sets the update interval to \f[CB]n\f[R] seconds (default is 4 seconds). Sets the update interval to \f[V]n\f[R] seconds (default is 4 seconds).
.RS
.RE
.TP .TP
.B \f[CB]\-notile\f[R] \f[V]-notile\f[R]
Doesn\[aq]t tile the windows for two or more connections. Doesn\[aq]t tile the windows for two or more connections.
.RS
.RE
.TP .TP
.B \f[CB]\-pluginpath\f[R] \f[I]path\f[R] \f[V]-pluginpath\f[R] \f[I]path\f[R]
Specifies the path that \f[CB]jconsole\f[R] uses to look up plug\-ins. Specifies the path that \f[V]jconsole\f[R] uses to look up plug-ins.
The plug\-in \f[I]path\f[R] should contain a provider\-configuration file The plug-in \f[I]path\f[R] should contain a provider-configuration file
named \f[CB]META\-INF/services/com.sun.tools.jconsole.JConsolePlugin\f[R] named \f[V]META-INF/services/com.sun.tools.jconsole.JConsolePlugin\f[R]
that contains one line for each plug\-in. that contains one line for each plug-in.
The line specifies the fully qualified class name of the class The line specifies the fully qualified class name of the class
implementing the \f[CB]com.sun.tools.jconsole.JConsolePlugin\f[R] class. implementing the \f[V]com.sun.tools.jconsole.JConsolePlugin\f[R] class.
.RS
.RE
.TP .TP
.B \f[CB]\-version\f[R] \f[V]-version\f[R]
Prints the program version. Prints the program version.
.RS
.RE
.TP .TP
.B \f[I]connection\f[R] = \f[I]pid\f[R] | \f[I]host\f[R]\f[CB]:\f[R]\f[I]port\f[R] | \f[I]jmxURL\f[R] \f[I]connection\f[R] = \f[I]pid\f[R] | \f[I]host\f[R]\f[V]:\f[R]\f[I]port\f[R] | \f[I]jmxURL\f[R]
A connection is described by either \f[I]pid\f[R], A connection is described by either \f[I]pid\f[R],
\f[I]host\f[R]\f[CB]:\f[R]\f[I]port\f[R] or \f[I]jmxURL\f[R]. \f[I]host\f[R]\f[V]:\f[R]\f[I]port\f[R] or \f[I]jmxURL\f[R].
.RS .RS
.IP \[bu] 2 .IP \[bu] 2
The \f[I]pid\f[R] value is the process ID of a target process. The \f[I]pid\f[R] value is the process ID of a target process.
The JVM must be running with the same user ID as the user ID running the The JVM must be running with the same user ID as the user ID running the
\f[CB]jconsole\f[R] command. \f[V]jconsole\f[R] command.
.IP \[bu] 2 .IP \[bu] 2
The \f[I]host\f[R]\f[CB]:\f[R]\f[I]port\f[R] values are the name of the host The \f[I]host\f[R]\f[V]:\f[R]\f[I]port\f[R] values are the name of the
system on which the JVM is running, and the port number specified by the host system on which the JVM is running, and the port number specified
system property \f[CB]com.sun.management.jmxremote.port\f[R] when the JVM by the system property \f[V]com.sun.management.jmxremote.port\f[R] when
was started. the JVM was started.
.IP \[bu] 2 .IP \[bu] 2
The \f[I]jmxUrl\f[R] value is the address of the JMX agent to be The \f[I]jmxUrl\f[R] value is the address of the JMX agent to be
connected to as described in JMXServiceURL. connected to as described in JMXServiceURL.
.RE .RE
.TP .TP
.B \f[CB]\-J\f[R]\f[I]input_arguments\f[R] \f[V]-J\f[R]\f[I]input_arguments\f[R]
Passes \f[I]input_arguments\f[R] to the JVM on which the Passes \f[I]input_arguments\f[R] to the JVM on which the
\f[CB]jconsole\f[R] command is run. \f[V]jconsole\f[R] command is run.
.RS
.RE
.TP .TP
.B \f[CB]\-help\f[R] or \f[CB]\-\-help\f[R] \f[V]-help\f[R] or \f[V]--help\f[R]
Displays the help message for the command. Displays the help message for the command.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jconsole\f[R] command starts a graphical console tool that lets The \f[V]jconsole\f[R] command starts a graphical console tool that lets
you monitor and manage Java applications and virtual machines on a local you monitor and manage Java applications and virtual machines on a local
or remote machine. or remote machine.
.PP .PP
On Windows, the \f[CB]jconsole\f[R] command doesn\[aq]t associate with a On Windows, the \f[V]jconsole\f[R] command doesn\[aq]t associate with a
console window. console window.
It does, however, display a dialog box with error information when the It does, however, display a dialog box with error information when the
\f[CB]jconsole\f[R] command fails. \f[V]jconsole\f[R] command fails.

View file

@ -19,24 +19,36 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JAVAP" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JAVAP" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
javap \- disassemble one or more class files javap - disassemble one or more class files
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]javap\f[R] [\f[I]options\f[R]] \f[I]classes\f[R]... \f[V]javap\f[R] [\f[I]options\f[R]] \f[I]classes\f[R]...
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
Specifies the command\-line options. Specifies the command-line options.
See \f[B]Options for javap\f[R]. See \f[B]Options for javap\f[R].
.RS
.RE
.TP .TP
.B \f[I]classes\f[R] \f[I]classes\f[R]
Specifies one or more classes separated by spaces to be processed for Specifies one or more classes separated by spaces to be processed for
annotations. annotations.
You can specify a class that can be found in the class path by its file You can specify a class that can be found in the class path by its file
@ -46,144 +58,108 @@ name, URL, or by its fully qualified class name.
Examples: Examples:
.RS .RS
.PP .PP
\f[CB]path/to/MyClass.class\f[R] \f[V]path/to/MyClass.class\f[R]
.RE .RE
.RS .RS
.PP .PP
\f[CB]jar:file:///path/to/MyJar.jar!/mypkg/MyClass.class\f[R] \f[V]jar:file:///path/to/MyJar.jar!/mypkg/MyClass.class\f[R]
.RE .RE
.RS .RS
.PP .PP
\f[CB]java.lang.Object\f[R] \f[V]java.lang.Object\f[R]
.RE .RE
.RE .RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]javap\f[R] command disassembles one or more class files. The \f[V]javap\f[R] command disassembles one or more class files.
The output depends on the options used. The output depends on the options used.
When no options are used, the \f[CB]javap\f[R] command prints the When no options are used, the \f[V]javap\f[R] command prints the
protected and public fields, and methods of the classes passed to it. protected and public fields, and methods of the classes passed to it.
.PP .PP
The \f[CB]javap\f[R] command isn\[aq]t multirelease JAR aware. The \f[V]javap\f[R] command isn\[aq]t multirelease JAR aware.
Using the class path form of the command results in viewing the base Using the class path form of the command results in viewing the base
entry in all JAR files, multirelease or not. entry in all JAR files, multirelease or not.
Using the URL form, you can use the URL form of an argument to specify a Using the URL form, you can use the URL form of an argument to specify a
specific version of a class to be disassembled. specific version of a class to be disassembled.
.PP .PP
The \f[CB]javap\f[R] command prints its output to \f[CB]stdout\f[R]. The \f[V]javap\f[R] command prints its output to \f[V]stdout\f[R].
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
In tools that support \f[CB]\-\-\f[R] style options, the GNU\-style In tools that support \f[V]--\f[R] style options, the GNU-style options
options can use the equal sign (\f[CB]=\f[R]) instead of a white space to can use the equal sign (\f[V]=\f[R]) instead of a white space to
separate the name of an option from its value. separate the name of an option from its value.
.SH OPTIONS FOR JAVAP .SH OPTIONS FOR JAVAP
.TP .TP
.B \f[CB]\-\-help\f[R], \f[CB]\-help\f[R] , \f[CB]\-h\f[R], or \f[CB]\-?\f[R] \f[V]--help\f[R], \f[V]-help\f[R] , \f[V]-h\f[R], or \f[V]-?\f[R]
Prints a help message for the \f[CB]javap\f[R] command. Prints a help message for the \f[V]javap\f[R] command.
.RS
.RE
.TP .TP
.B \f[CB]\-version\f[R] \f[V]-version\f[R]
Prints release information. Prints release information.
.RS
.RE
.TP .TP
.B \f[CB]\-verbose\f[R] or \f[CB]\-v\f[R] \f[V]-verbose\f[R] or \f[V]-v\f[R]
Prints additional information about the selected class. Prints additional information about the selected class.
.RS
.RE
.TP .TP
.B \f[CB]\-l\f[R] \f[V]-l\f[R]
Prints line and local variable tables. Prints line and local variable tables.
.RS
.RE
.TP .TP
.B \f[CB]\-public\f[R] \f[V]-public\f[R]
Shows only public classes and members. Shows only public classes and members.
.RS
.RE
.TP .TP
.B \f[CB]\-protected\f[R] \f[V]-protected\f[R]
Shows only protected and public classes and members. Shows only protected and public classes and members.
.RS
.RE
.TP .TP
.B \f[CB]\-package\f[R] \f[V]-package\f[R]
Shows package/protected/public classes and members (default). Shows package/protected/public classes and members (default).
.RS
.RE
.TP .TP
.B \f[CB]\-private\f[R] or \f[CB]\-p\f[R] \f[V]-private\f[R] or \f[V]-p\f[R]
Shows all classes and members. Shows all classes and members.
.RS
.RE
.TP .TP
.B \f[CB]\-c\f[R] \f[V]-c\f[R]
Prints disassembled code, for example, the instructions that comprise Prints disassembled code, for example, the instructions that comprise
the Java bytecodes, for each of the methods in the class. the Java bytecodes, for each of the methods in the class.
.RS
.RE
.TP .TP
.B \f[CB]\-s\f[R] \f[V]-s\f[R]
Prints internal type signatures. Prints internal type signatures.
.RS
.RE
.TP .TP
.B \f[CB]\-sysinfo\f[R] \f[V]-sysinfo\f[R]
Shows system information (path, size, date, SHA\-256 hash) of the class Shows system information (path, size, date, SHA-256 hash) of the class
being processed. being processed.
.RS
.RE
.TP .TP
.B \f[CB]\-constants\f[R] \f[V]-constants\f[R]
Shows \f[CB]static\ final\f[R] constants. Shows \f[V]static final\f[R] constants.
.RS
.RE
.TP .TP
.B \f[CB]\-\-module\f[R] \f[I]module\f[R] or \f[CB]\-m\f[R] \f[I]module\f[R] \f[V]--module\f[R] \f[I]module\f[R] or \f[V]-m\f[R] \f[I]module\f[R]
Specifies the module containing classes to be disassembled. Specifies the module containing classes to be disassembled.
.RS
.RE
.TP .TP
.B \f[CB]\-\-module\-path\f[R] \f[I]path\f[R] \f[V]--module-path\f[R] \f[I]path\f[R]
Specifies where to find application modules. Specifies where to find application modules.
.RS
.RE
.TP .TP
.B \f[CB]\-\-system\f[R] \f[I]jdk\f[R] \f[V]--system\f[R] \f[I]jdk\f[R]
Specifies where to find system modules. Specifies where to find system modules.
.RS
.RE
.TP .TP
.B \f[CB]\-\-class\-path\f[R] \f[I]path\f[R], \f[CB]\-classpath\f[R] \f[I]path\f[R], or \f[CB]\-cp\f[R] \f[I]path\f[R] \f[V]--class-path\f[R] \f[I]path\f[R], \f[V]-classpath\f[R] \f[I]path\f[R], or \f[V]-cp\f[R] \f[I]path\f[R]
Specifies the path that the \f[CB]javap\f[R] command uses to find user Specifies the path that the \f[V]javap\f[R] command uses to find user
class files. class files.
It overrides the default or the \f[CB]CLASSPATH\f[R] environment variable It overrides the default or the \f[V]CLASSPATH\f[R] environment variable
when it\[aq]s set. when it\[aq]s set.
.RS
.RE
.TP .TP
.B \f[CB]\-bootclasspath\f[R] \f[I]path\f[R] \f[V]-bootclasspath\f[R] \f[I]path\f[R]
Overrides the location of bootstrap class files. Overrides the location of bootstrap class files.
.RS
.RE
.TP .TP
.B \f[CB]\-\-multi\-release\f[R] \f[I]version\f[R] \f[V]--multi-release\f[R] \f[I]version\f[R]
Specifies the version to select in multi\-release JAR files. Specifies the version to select in multi-release JAR files.
.RS
.RE
.TP .TP
.B \f[CB]\-J\f[R]\f[I]option\f[R] \f[V]-J\f[R]\f[I]option\f[R]
Passes the specified option to the JVM. Passes the specified option to the JVM.
For example: For example:
.RS .RS
.IP .IP
.nf .nf
\f[CB] \f[CB]
javap\ \-J\-version javap -J-version
javap\ \-J\-Djava.security.manager\ \-J\-Djava.security.policy=MyPolicy\ MyClassName javap -J-Djava.security.manager -J-Djava.security.policy=MyPolicy MyClassName
\f[R] \f[R]
.fi .fi
.PP .PP
@ -191,90 +167,90 @@ See \f[I]Overview of Java Options\f[R] in \f[B]java\f[R].
.RE .RE
.SH JAVAP EXAMPLE .SH JAVAP EXAMPLE
.PP .PP
Compile the following \f[CB]HelloWorldFrame\f[R] class: Compile the following \f[V]HelloWorldFrame\f[R] class:
.IP .IP
.nf .nf
\f[CB] \f[CB]
import\ java.awt.Graphics; import java.awt.Graphics;
import\ javax.swing.JFrame; import javax.swing.JFrame;
import\ javax.swing.JPanel; import javax.swing.JPanel;
public\ class\ HelloWorldFrame\ extends\ JFrame\ { public class HelloWorldFrame extends JFrame {
\ \ \ String\ message\ =\ "Hello\ World!"; String message = \[dq]Hello World!\[dq];
\ \ \ public\ HelloWorldFrame(){ public HelloWorldFrame(){
\ \ \ \ \ \ \ \ setContentPane(new\ JPanel(){ setContentPane(new JPanel(){
\ \ \ \ \ \ \ \ \ \ \ \ \@Override \[at]Override
\ \ \ \ \ \ \ \ \ \ \ \ protected\ void\ paintComponent(Graphics\ g)\ { protected void paintComponent(Graphics g) {
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ g.drawString(message,\ 15,\ 30); g.drawString(message, 15, 30);
\ \ \ \ \ \ \ \ \ \ \ \ } }
\ \ \ \ \ \ \ \ }); });
\ \ \ \ \ \ \ \ setSize(100,\ 100); setSize(100, 100);
\ \ \ \ } }
\ \ \ \ public\ static\ void\ main(String[]\ args)\ { public static void main(String[] args) {
\ \ \ \ \ \ \ \ HelloWorldFrame\ frame\ =\ new\ HelloWorldFrame(); HelloWorldFrame frame = new HelloWorldFrame();
\ \ \ \ \ \ \ \ frame.setVisible(true); frame.setVisible(true);
\ \ \ \ } }
} }
\f[R] \f[R]
.fi .fi
.PP .PP
The output from the \f[CB]javap\ HelloWorldFrame.class\f[R] command yields The output from the \f[V]javap HelloWorldFrame.class\f[R] command yields
the following: the following:
.IP .IP
.nf .nf
\f[CB] \f[CB]
Compiled\ from\ "HelloWorldFrame.java" Compiled from \[dq]HelloWorldFrame.java\[dq]
public\ class\ HelloWorldFrame\ extends\ javax.swing.JFrame\ { public class HelloWorldFrame extends javax.swing.JFrame {
\ \ java.lang.String\ message; java.lang.String message;
\ \ public\ HelloWorldFrame(); public HelloWorldFrame();
\ \ public\ static\ void\ main(java.lang.String[]); public static void main(java.lang.String[]);
} }
\f[R] \f[R]
.fi .fi
.PP .PP
The output from the \f[CB]javap\ \-c\ HelloWorldFrame.class\f[R] command The output from the \f[V]javap -c HelloWorldFrame.class\f[R] command
yields the following: yields the following:
.IP .IP
.nf .nf
\f[CB] \f[CB]
Compiled\ from\ "HelloWorldFrame.java" Compiled from \[dq]HelloWorldFrame.java\[dq]
public\ class\ HelloWorldFrame\ extends\ javax.swing.JFrame\ { public class HelloWorldFrame extends javax.swing.JFrame {
\ \ java.lang.String\ message; java.lang.String message;
\ \ public\ HelloWorldFrame(); public HelloWorldFrame();
\ \ \ \ Code: Code:
\ \ \ \ \ \ \ 0:\ aload_0 0: aload_0
\ \ \ \ \ \ \ 1:\ invokespecial\ #1\ \ \ \ \ \ \ \ //\ Method\ javax/swing/JFrame."<init>":()V 1: invokespecial #1 // Method javax/swing/JFrame.\[dq]<init>\[dq]:()V
\ \ \ \ \ \ \ 4:\ aload_0 4: aload_0
\ \ \ \ \ \ \ 5:\ ldc\ \ \ \ \ \ \ \ \ \ \ #2\ \ \ \ \ \ \ \ //\ String\ Hello\ World! 5: ldc #2 // String Hello World!
\ \ \ \ \ \ \ 7:\ putfield\ \ \ \ \ \ #3\ \ \ \ \ \ \ \ //\ Field\ message:Ljava/lang/String; 7: putfield #3 // Field message:Ljava/lang/String;
\ \ \ \ \ \ 10:\ aload_0 10: aload_0
\ \ \ \ \ \ 11:\ new\ \ \ \ \ \ \ \ \ \ \ #4\ \ \ \ \ \ \ \ //\ class\ HelloWorldFrame$1 11: new #4 // class HelloWorldFrame$1
\ \ \ \ \ \ 14:\ dup 14: dup
\ \ \ \ \ \ 15:\ aload_0 15: aload_0
\ \ \ \ \ \ 16:\ invokespecial\ #5\ \ \ \ \ \ \ \ //\ Method\ HelloWorldFrame$1."<init>":(LHelloWorldFrame;)V 16: invokespecial #5 // Method HelloWorldFrame$1.\[dq]<init>\[dq]:(LHelloWorldFrame;)V
\ \ \ \ \ \ 19:\ invokevirtual\ #6\ \ \ \ \ \ \ \ //\ Method\ setContentPane:(Ljava/awt/Container;)V 19: invokevirtual #6 // Method setContentPane:(Ljava/awt/Container;)V
\ \ \ \ \ \ 22:\ aload_0 22: aload_0
\ \ \ \ \ \ 23:\ bipush\ \ \ \ \ \ \ \ 100 23: bipush 100
\ \ \ \ \ \ 25:\ bipush\ \ \ \ \ \ \ \ 100 25: bipush 100
\ \ \ \ \ \ 27:\ invokevirtual\ #7\ \ \ \ \ \ \ \ //\ Method\ setSize:(II)V 27: invokevirtual #7 // Method setSize:(II)V
\ \ \ \ \ \ 30:\ return 30: return
\ \ public\ static\ void\ main(java.lang.String[]); public static void main(java.lang.String[]);
\ \ \ \ Code: Code:
\ \ \ \ \ \ \ 0:\ new\ \ \ \ \ \ \ \ \ \ \ #8\ \ \ \ \ \ \ \ //\ class\ HelloWorldFrame 0: new #8 // class HelloWorldFrame
\ \ \ \ \ \ \ 3:\ dup 3: dup
\ \ \ \ \ \ \ 4:\ invokespecial\ #9\ \ \ \ \ \ \ \ //\ Method\ "<init>":()V 4: invokespecial #9 // Method \[dq]<init>\[dq]:()V
\ \ \ \ \ \ \ 7:\ astore_1 7: astore_1
\ \ \ \ \ \ \ 8:\ aload_1 8: aload_1
\ \ \ \ \ \ \ 9:\ iconst_1 9: iconst_1
\ \ \ \ \ \ 10:\ invokevirtual\ #10\ \ \ \ \ \ \ //\ Method\ setVisible:(Z)V 10: invokevirtual #10 // Method setVisible:(Z)V
\ \ \ \ \ \ 13:\ return 13: return
} }
\f[R] \f[R]
.fi .fi

View file

@ -19,26 +19,38 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JDEPRSCAN" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JDEPRSCAN" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jdeprscan \- static analysis tool that scans a jar file (or some other jdeprscan - static analysis tool that scans a jar file (or some other
aggregation of class files) for uses of deprecated API elements aggregation of class files) for uses of deprecated API elements
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jdeprscan\f[R] [\f[I]options\f[R]] \f[V]jdeprscan\f[R] [\f[I]options\f[R]]
{\f[I]dir\f[R]|\f[I]jar\f[R]|\f[I]class\f[R]} {\f[I]dir\f[R]|\f[I]jar\f[R]|\f[I]class\f[R]}
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
See \f[B]Options for the jdeprscan Command\f[R] See \f[B]Options for the jdeprscan Command\f[R]
.RS
.RE
.TP .TP
.B \f[I]dir\f[R]|\f[I]jar\f[R]|\f[I]class\f[R] \f[I]dir\f[R]|\f[I]jar\f[R]|\f[I]class\f[R]
\f[CB]jdeprscan\f[R] command scans each argument for usages of deprecated \f[V]jdeprscan\f[R] command scans each argument for usages of deprecated
APIs. APIs.
The arguments can be a: The arguments can be a:
.RS .RS
@ -49,45 +61,45 @@ The arguments can be a:
.IP \[bu] 2 .IP \[bu] 2
\f[I]class\f[R]: Class name or class file \f[I]class\f[R]: Class name or class file
.PP .PP
The class name should use a dot (\f[CB]\&.\f[R]) as a separator. The class name should use a dot (\f[V].\f[R]) as a separator.
For example: For example:
.PP .PP
\f[CB]java.lang.Thread\f[R] \f[V]java.lang.Thread\f[R]
.PP .PP
For nested classes, the dollar sign \f[CB]$\f[R] separator character For nested classes, the dollar sign \f[V]$\f[R] separator character
should be used. should be used.
For example: For example:
.PP .PP
\f[CB]java.lang.Thread$State\f[R] \f[V]java.lang.Thread$State\f[R]
.PP .PP
A class file can also be named. A class file can also be named.
For example: For example:
.PP .PP
\f[CB]build/classes/java/lang/Thread$State.class\f[R] \f[V]build/classes/java/lang/Thread$State.class\f[R]
.RE .RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jdeprscan\f[R] tool is a static analysis tool provided by the The \f[V]jdeprscan\f[R] tool is a static analysis tool provided by the
JDK that scans a JAR file or some other aggregation of class files for JDK that scans a JAR file or some other aggregation of class files for
uses of deprecated API elements. uses of deprecated API elements.
The deprecated APIs identified by the \f[CB]jdeprscan\f[R] tool are only The deprecated APIs identified by the \f[V]jdeprscan\f[R] tool are only
those that are defined by Java SE. those that are defined by Java SE.
Deprecated APIs defined by third\-party libraries aren\[aq]t reported. Deprecated APIs defined by third-party libraries aren\[aq]t reported.
.PP .PP
To scan a JAR file or a set of class files, you must first ensure that To scan a JAR file or a set of class files, you must first ensure that
all of the classes that the scanned classes depend upon are present in all of the classes that the scanned classes depend upon are present in
the class path. the class path.
Set the class path using the \f[CB]\-\-class\-path\f[R] option described Set the class path using the \f[V]--class-path\f[R] option described in
in \f[B]Options for the jdeprscan Command\f[R]. \f[B]Options for the jdeprscan Command\f[R].
Typically, you would use the same class path as the one that you use Typically, you would use the same class path as the one that you use
when invoking your application. when invoking your application.
.PP .PP
If the \f[CB]jdeprscan\f[R] can\[aq]t find all the dependent classes, it If the \f[V]jdeprscan\f[R] can\[aq]t find all the dependent classes, it
will generate an error message for each class that\[aq]s missing. will generate an error message for each class that\[aq]s missing.
These error messages are typically of the form: These error messages are typically of the form:
.RS .RS
.PP .PP
\f[CB]error:\ cannot\ find\ class\ ...\f[R] \f[V]error: cannot find class ...\f[R]
.RE .RE
.PP .PP
If these errors occur, then you must adjust the class path so that it If these errors occur, then you must adjust the class path so that it
@ -96,83 +108,69 @@ includes all dependent classes.
.PP .PP
The following options are available: The following options are available:
.TP .TP
.B \f[CB]\-\-class\-path\f[R] \f[I]path\f[R] \f[V]--class-path\f[R] \f[I]path\f[R]
Provides a search path for resolution of dependent classes. Provides a search path for resolution of dependent classes.
.RS .RS
.PP .PP
\f[I]path\f[R] can be a search path that consists of one or more \f[I]path\f[R] can be a search path that consists of one or more
directories separated by the system\-specific path separator. directories separated by the system-specific path separator.
For example: For example:
.IP \[bu] 2 .IP \[bu] 2
\f[B]Linux and OS X:\f[R] \f[B]Linux and OS X:\f[R]
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]\-\-class\-path\ /some/directory:/another/different/dir\f[R] \f[V]--class-path /some/directory:/another/different/dir\f[R]
.RE .RE
.RE .RE
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
On Windows, use a semicolon (\f[CB];\f[R]) as the separator instead of a On Windows, use a semicolon (\f[V];\f[R]) as the separator instead of a
colon (\f[CB]:\f[R]). colon (\f[V]:\f[R]).
.IP \[bu] 2 .IP \[bu] 2
\f[B]Windows:\f[R] \f[B]Windows:\f[R]
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]\-\-class\-path\ \\some\\directory;\\another\\different\\dir\f[R] \f[V]--class-path \[rs]some\[rs]directory;\[rs]another\[rs]different\[rs]dir\f[R]
.RE .RE
.RE .RE
.RE .RE
.TP .TP
.B \f[CB]\-\-for\-removal\f[R] \f[V]--for-removal\f[R]
Limits scanning or listing to APIs that are deprecated for removal. Limits scanning or listing to APIs that are deprecated for removal.
Can\[aq]t be used with a release value of 6, 7, or 8. Can\[aq]t be used with a release value of 6, 7, or 8.
.RS
.RE
.TP .TP
.B \f[CB]\-\-full\-version\f[R] \f[V]--full-version\f[R]
Prints out the full version string of the tool. Prints out the full version string of the tool.
.RS
.RE
.TP .TP
.B \f[CB]\-\-help\f[R] or \f[CB]\-h\f[R] \f[V]--help\f[R] or \f[V]-h\f[R]
Prints out a full help message. Prints out a full help message.
.RS
.RE
.TP .TP
.B \f[CB]\-\-list\f[R] or \f[CB]\-l\f[R] \f[V]--list\f[R] or \f[V]-l\f[R]
Prints the set of deprecated APIs. Prints the set of deprecated APIs.
No scanning is done, so no directory, jar, or class arguments should be No scanning is done, so no directory, jar, or class arguments should be
provided. provided.
.RS
.RE
.TP .TP
.B \f[CB]\-\-release\f[R] \f[CB]6\f[R]|\f[CB]7\f[R]|\f[CB]8\f[R]|\f[CB]9\f[R] \f[V]--release\f[R] \f[V]6\f[R]|\f[V]7\f[R]|\f[V]8\f[R]|\f[V]9\f[R]
Specifies the Java SE release that provides the set of deprecated APIs Specifies the Java SE release that provides the set of deprecated APIs
for scanning. for scanning.
.RS
.RE
.TP .TP
.B \f[CB]\-\-verbose\f[R] or \f[CB]\-v\f[R] \f[V]--verbose\f[R] or \f[V]-v\f[R]
Enables additional message output during processing. Enables additional message output during processing.
.RS
.RE
.TP .TP
.B \f[CB]\-\-version\f[R] \f[V]--version\f[R]
Prints out the abbreviated version string of the tool. Prints out the abbreviated version string of the tool.
.RS
.RE
.SH EXAMPLE OF JDEPRSCAN OUTPUT .SH EXAMPLE OF JDEPRSCAN OUTPUT
.PP .PP
The JAR file for this library will be named something similar to The JAR file for this library will be named something similar to
\f[CB]commons\-math3\-3.6.1.jar\f[R]. \f[V]commons-math3-3.6.1.jar\f[R].
To scan this JAR file for the use of deprecated APIs, run the following To scan this JAR file for the use of deprecated APIs, run the following
command: command:
.RS .RS
.PP .PP
\f[CB]jdeprscan\ commons\-math3\-3.6.1.jar\f[R] \f[V]jdeprscan commons-math3-3.6.1.jar\f[R]
.RE .RE
.PP .PP
This command produces several lines of output. This command produces several lines of output.
@ -180,29 +178,29 @@ For example, one line of output might be:
.IP .IP
.nf .nf
\f[CB] \f[CB]
class\ org/apache/commons/math3/util/MathUtils\ uses\ deprecated\ method\ java/lang/Double::<init>(D)V class org/apache/commons/math3/util/MathUtils uses deprecated method java/lang/Double::<init>(D)V
\f[R] \f[R]
.fi .fi
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
The class name is specified using the slash\-separated binary name as The class name is specified using the slash-separated binary name as
described in JVMS 4.2.1. described in JVMS 4.2.1.
This is the form used internally in class files. This is the form used internally in class files.
.PP .PP
The deprecated API it uses is a method on the \f[CB]java.lang.Double\f[R] The deprecated API it uses is a method on the \f[V]java.lang.Double\f[R]
class. class.
.PP .PP
The name of the deprecated method is \f[CB]<init>\f[R], which is a special The name of the deprecated method is \f[V]<init>\f[R], which is a
name that means that the method is actually a constructor. special name that means that the method is actually a constructor.
Another special name is \f[CB]<clinit>\f[R], which indicates a class Another special name is \f[V]<clinit>\f[R], which indicates a class
static initializer. static initializer.
.PP .PP
Other methods are listed just by their method name. Other methods are listed just by their method name.
Following the method name is the argument list and return type: Following the method name is the argument list and return type:
.RS .RS
.PP .PP
\f[CB](D)V\f[R] \f[V](D)V\f[R]
.RE .RE
.PP .PP
This indicates that it takes just one double value (a primitive) and This indicates that it takes just one double value (a primitive) and
@ -212,19 +210,19 @@ For example, another line of output might be:
.IP .IP
.nf .nf
\f[CB] \f[CB]
class\ org/apache/commons/math3/util/Precision\ uses\ deprecated\ method\ java/math/BigDecimal::setScale(II)Ljava/math/BigDecimal; class org/apache/commons/math3/util/Precision uses deprecated method java/math/BigDecimal::setScale(II)Ljava/math/BigDecimal;
\f[R] \f[R]
.fi .fi
.PP .PP
In this line of output, the deprecated method is on class In this line of output, the deprecated method is on class
\f[CB]java.math.BigDecimal\f[R], and the method is \f[CB]setScale()\f[R]. \f[V]java.math.BigDecimal\f[R], and the method is \f[V]setScale()\f[R].
In this case, the \f[CB](II)\f[R] means that it takes two \f[CB]int\f[R] In this case, the \f[V](II)\f[R] means that it takes two \f[V]int\f[R]
arguments. arguments.
The \f[CB]Ljava/math/BigDecimal;\f[R] after the parentheses means that it The \f[V]Ljava/math/BigDecimal;\f[R] after the parentheses means that it
returns a reference to \f[CB]java.math.BigDecimal\f[R]. returns a reference to \f[V]java.math.BigDecimal\f[R].
.SH JDEPRSCAN ANALYSIS CAN BE VERSION\-SPECIFIC .SH JDEPRSCAN ANALYSIS CAN BE VERSION-SPECIFIC
.PP .PP
You can use \f[CB]jdeprscan\f[R] relative to the previous three JDK You can use \f[V]jdeprscan\f[R] relative to the previous three JDK
releases. releases.
For example, if you are running JDK 9, then you can check against JDK 8, For example, if you are running JDK 9, then you can check against JDK 8,
7, and 6. 7, and 6.
@ -233,41 +231,41 @@ As an example, look at this code snippet:
.IP .IP
.nf .nf
\f[CB] \f[CB]
public\ class\ Deprecations\ { public class Deprecations {
\ \ \ SecurityManager\ sm\ =\ new\ RMISecurityManager();\ \ \ \ //\ deprecated\ in\ 8 SecurityManager sm = new RMISecurityManager(); // deprecated in 8
\ \ \ Boolean\ b2\ =\ new\ Boolean(true);\ \ \ \ \ \ \ \ \ \ //\ deprecated\ in\ 9 Boolean b2 = new Boolean(true); // deprecated in 9
} }
\f[R] \f[R]
.fi .fi
.PP .PP
The complete class compiles without warnings in JDK 7. The complete class compiles without warnings in JDK 7.
.PP .PP
If you run \f[CB]jdeprscan\f[R] on a system with JDK 9, then you see: If you run \f[V]jdeprscan\f[R] on a system with JDK 9, then you see:
.IP .IP
.nf .nf
\f[CB] \f[CB]
$\ jdeprscan\ \-\-class\-path\ classes\ \-\-release\ 7\ example.Deprecations $ jdeprscan --class-path classes --release 7 example.Deprecations
(no\ output) (no output)
\f[R] \f[R]
.fi .fi
.PP .PP
Run \f[CB]jdeprscan\f[R] with a release value of 8: Run \f[V]jdeprscan\f[R] with a release value of 8:
.IP .IP
.nf .nf
\f[CB] \f[CB]
$\ jdeprscan\ \-\-class\-path\ classes\ \-\-release\ 8\ example.Deprecations $ jdeprscan --class-path classes --release 8 example.Deprecations
class\ example/Deprecations\ uses\ type\ java/rmi/RMISecurityManager\ deprecated class example/Deprecations uses type java/rmi/RMISecurityManager deprecated
class\ example/Deprecations\ uses\ method\ in\ type\ java/rmi/RMISecurityManager\ deprecated class example/Deprecations uses method in type java/rmi/RMISecurityManager deprecated
\f[R] \f[R]
.fi .fi
.PP .PP
Run \f[CB]jdeprscan\f[R] on JDK 9: Run \f[V]jdeprscan\f[R] on JDK 9:
.IP .IP
.nf .nf
\f[CB] \f[CB]
$\ jdeprscan\ \-\-class\-path\ classes\ example.Deprecations $ jdeprscan --class-path classes example.Deprecations
class\ example/Deprecations\ uses\ type\ java/rmi/RMISecurityManager\ deprecated class example/Deprecations uses type java/rmi/RMISecurityManager deprecated
class\ example/Deprecations\ uses\ method\ in\ type\ java/rmi/RMISecurityManager\ deprecated class example/Deprecations uses method in type java/rmi/RMISecurityManager deprecated
class\ example/Deprecations\ uses\ method\ java/lang/Boolean\ <init>\ (Z)V\ deprecated class example/Deprecations uses method java/lang/Boolean <init> (Z)V deprecated
\f[R] \f[R]
.fi .fi

View file

@ -19,19 +19,33 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JDEPS" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JDEPS" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jdeps \- launch the Java class dependency analyzer jdeps - launch the Java class dependency analyzer
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jdeps\f[R] [\f[I]options\f[R]] \f[I]path\f[R] ... \f[V]jdeps\f[R] [\f[I]options\f[R]] \f[I]path\f[R] ...
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
Command\-line options. Command-line options.
For detailed descriptions of the options that can be used, see For detailed descriptions of the options that can be used, see
.RS .RS
.IP \[bu] 2 .IP \[bu] 2
@ -44,322 +58,246 @@ For detailed descriptions of the options that can be used, see
\f[B]Options to Filter Classes to be Analyzed\f[R] \f[B]Options to Filter Classes to be Analyzed\f[R]
.RE .RE
.TP .TP
.B \f[I]path\f[R] \f[I]path\f[R]
A pathname to the \f[CB]\&.class\f[R] file, directory, or JAR file to A pathname to the \f[V].class\f[R] file, directory, or JAR file to
analyze. analyze.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jdeps\f[R] command shows the package\-level or class\-level The \f[V]jdeps\f[R] command shows the package-level or class-level
dependencies of Java class files. dependencies of Java class files.
The input class can be a path name to a \f[CB]\&.class\f[R] file, a The input class can be a path name to a \f[V].class\f[R] file, a
directory, a JAR file, or it can be a fully qualified class name to directory, a JAR file, or it can be a fully qualified class name to
analyze all class files. analyze all class files.
The options determine the output. The options determine the output.
By default, the \f[CB]jdeps\f[R] command writes the dependencies to the By default, the \f[V]jdeps\f[R] command writes the dependencies to the
system output. system output.
The command can generate the dependencies in DOT language (see the The command can generate the dependencies in DOT language (see the
\f[CB]\-dotoutput\f[R] option). \f[V]-dotoutput\f[R] option).
.SH POSSIBLE OPTIONS .SH POSSIBLE OPTIONS
.TP .TP
.B \f[CB]\-?\f[R] or \f[CB]\-h\f[R] or \f[CB]\-\-help\f[R] \f[V]-?\f[R] or \f[V]-h\f[R] or \f[V]--help\f[R]
Prints the help message. Prints the help message.
.RS
.RE
.TP .TP
.B \f[CB]\-dotoutput\f[R] \f[I]dir\f[R] or \f[CB]\-\-dot\-output\f[R] \f[I]dir\f[R] \f[V]-dotoutput\f[R] \f[I]dir\f[R] or \f[V]--dot-output\f[R] \f[I]dir\f[R]
Specifies the destination directory for DOT file output. Specifies the destination directory for DOT file output.
If this option is specified, then the \f[CB]jdeps\f[R]command generates If this option is specified, then the \f[V]jdeps\f[R]command generates
one \f[CB]\&.dot\f[R] file for each analyzed archive named one \f[V].dot\f[R] file for each analyzed archive named
\f[CB]archive\-file\-name.dot\f[R] that lists the dependencies, and also a \f[V]archive-file-name.dot\f[R] that lists the dependencies, and also a
summary file named \f[CB]summary.dot\f[R] that lists the dependencies summary file named \f[V]summary.dot\f[R] that lists the dependencies
among the archive files. among the archive files.
.RS
.RE
.TP .TP
.B \f[CB]\-s\f[R] or \f[CB]\-summary\f[R] \f[V]-s\f[R] or \f[V]-summary\f[R]
Prints a dependency summary only. Prints a dependency summary only.
.RS
.RE
.TP .TP
.B \f[CB]\-v\f[R] or \f[CB]\-verbose\f[R] \f[V]-v\f[R] or \f[V]-verbose\f[R]
Prints all class\-level dependencies. Prints all class-level dependencies.
This is equivalent to This is equivalent to
.RS .RS
.RS .RS
.PP .PP
\f[CB]\-verbose:class\ \-filter:none\f[R] \f[V]-verbose:class -filter:none\f[R]
.RE .RE
.RE .RE
.TP .TP
.B \f[CB]\-verbose:package\f[R] \f[V]-verbose:package\f[R]
Prints package\-level dependencies excluding, by default, dependences Prints package-level dependencies excluding, by default, dependences
within the same package. within the same package.
.RS
.RE
.TP .TP
.B \f[CB]\-verbose:class\f[R] \f[V]-verbose:class\f[R]
Prints class\-level dependencies excluding, by default, dependencies Prints class-level dependencies excluding, by default, dependencies
within the same archive. within the same archive.
.RS
.RE
.TP .TP
.B \f[CB]\-apionly\f[R] or \f[CB]\-\-api\-only\f[R] \f[V]-apionly\f[R] or \f[V]--api-only\f[R]
Restricts the analysis to APIs, for example, dependences from the Restricts the analysis to APIs, for example, dependences from the
signature of \f[CB]public\f[R] and \f[CB]protected\f[R] members of public signature of \f[V]public\f[R] and \f[V]protected\f[R] members of public
classes including field type, method parameter types, returned type, and classes including field type, method parameter types, returned type, and
checked exception types. checked exception types.
.RS
.RE
.TP .TP
.B \f[CB]\-jdkinternals\f[R] or \f[CB]\-\-jdk\-internals\f[R] \f[V]-jdkinternals\f[R] or \f[V]--jdk-internals\f[R]
Finds class\-level dependences in the JDK internal APIs. Finds class-level dependences in the JDK internal APIs.
By default, this option analyzes all classes specified in the By default, this option analyzes all classes specified in the
\f[CB]\-\-classpath\f[R] option and input files unless you specified the \f[V]--classpath\f[R] option and input files unless you specified the
\f[CB]\-include\f[R] option. \f[V]-include\f[R] option.
You can\[aq]t use this option with the \f[CB]\-p\f[R], \f[CB]\-e\f[R], and You can\[aq]t use this option with the \f[V]-p\f[R], \f[V]-e\f[R], and
\f[CB]\-s\f[R] options. \f[V]-s\f[R] options.
.RS .RS
.PP .PP
\f[B]Warning\f[R]: The JDK internal APIs are inaccessible. \f[B]Warning\f[R]: The JDK internal APIs are inaccessible.
.RE .RE
.TP .TP
.B \f[CB]\-cp\f[R] \f[I]path\f[R], \f[CB]\-classpath\f[R] \f[I]path\f[R], or \f[CB]\-\-class\-path\f[R] \f[I]path\f[R] \f[V]-cp\f[R] \f[I]path\f[R], \f[V]-classpath\f[R] \f[I]path\f[R], or \f[V]--class-path\f[R] \f[I]path\f[R]
Specifies where to find class files. Specifies where to find class files.
.RS
.RE
.TP .TP
.B \f[CB]\-\-module\-path\f[R] \f[I]module\-path\f[R] \f[V]--module-path\f[R] \f[I]module-path\f[R]
Specifies the module path. Specifies the module path.
.RS
.RE
.TP .TP
.B \f[CB]\-\-upgrade\-module\-path\f[R] \f[I]module\-path\f[R] \f[V]--upgrade-module-path\f[R] \f[I]module-path\f[R]
Specifies the upgrade module path. Specifies the upgrade module path.
.RS
.RE
.TP .TP
.B \f[CB]\-\-system\f[R] \f[I]java\-home\f[R] \f[V]--system\f[R] \f[I]java-home\f[R]
Specifies an alternate system module path. Specifies an alternate system module path.
.RS
.RE
.TP .TP
.B \f[CB]\-\-add\-modules\f[R] \f[I]module\-name\f[R][\f[CB],\f[R] \f[I]module\-name\f[R]...] \f[V]--add-modules\f[R] \f[I]module-name\f[R][\f[V],\f[R] \f[I]module-name\f[R]...]
Adds modules to the root set for analysis. Adds modules to the root set for analysis.
.RS
.RE
.TP .TP
.B \f[CB]\-\-multi\-release\f[R] \f[I]version\f[R] \f[V]--multi-release\f[R] \f[I]version\f[R]
Specifies the version when processing multi\-release JAR files. Specifies the version when processing multi-release JAR files.
\f[I]version\f[R] should be an integer >=9 or base. \f[I]version\f[R] should be an integer >=9 or base.
.RS
.RE
.TP .TP
.B \f[CB]\-q\f[R] or \f[CB]\-quiet\f[R] \f[V]-q\f[R] or \f[V]-quiet\f[R]
Doesn\[aq]t show missing dependencies from Doesn\[aq]t show missing dependencies from
\f[CB]\-generate\-module\-info\f[R] output. \f[V]-generate-module-info\f[R] output.
.RS
.RE
.TP .TP
.B \f[CB]\-version\f[R] or \f[CB]\-\-version\f[R] \f[V]-version\f[R] or \f[V]--version\f[R]
Prints version information. Prints version information.
.RS
.RE
.SH MODULE DEPENDENCE ANALYSIS OPTIONS .SH MODULE DEPENDENCE ANALYSIS OPTIONS
.TP .TP
.B \f[CB]\-m\f[R] \f[I]module\-name\f[R] or \f[CB]\-\-module\f[R] \f[I]module\-name\f[R] \f[V]-m\f[R] \f[I]module-name\f[R] or \f[V]--module\f[R] \f[I]module-name\f[R]
Specifies the root module for analysis. Specifies the root module for analysis.
.RS
.RE
.TP .TP
.B \f[CB]\-\-generate\-module\-info\f[R] \f[I]dir\f[R] \f[V]--generate-module-info\f[R] \f[I]dir\f[R]
Generates \f[CB]module\-info.java\f[R] under the specified directory. Generates \f[V]module-info.java\f[R] under the specified directory.
The specified JAR files will be analyzed. The specified JAR files will be analyzed.
This option cannot be used with \f[CB]\-\-dot\-output\f[R] or This option cannot be used with \f[V]--dot-output\f[R] or
\f[CB]\-\-class\-path\f[R] options. \f[V]--class-path\f[R] options.
Use the \f[CB]\-\-generate\-open\-module\f[R] option for open modules. Use the \f[V]--generate-open-module\f[R] option for open modules.
.RS
.RE
.TP .TP
.B \f[CB]\-\-generate\-open\-module\f[R] \f[I]dir\f[R] \f[V]--generate-open-module\f[R] \f[I]dir\f[R]
Generates \f[CB]module\-info.java\f[R] for the specified JAR files under Generates \f[V]module-info.java\f[R] for the specified JAR files under
the specified directory as open modules. the specified directory as open modules.
This option cannot be used with the \f[CB]\-\-dot\-output\f[R] or This option cannot be used with the \f[V]--dot-output\f[R] or
\f[CB]\-\-class\-path\f[R] options. \f[V]--class-path\f[R] options.
.RS
.RE
.TP .TP
.B \f[CB]\-\-check\f[R] \f[I]module\-name\f[R] [\f[CB],\f[R] \f[I]module\-name\f[R]...] \f[V]--check\f[R] \f[I]module-name\f[R] [\f[V],\f[R] \f[I]module-name\f[R]...]
Analyzes the dependence of the specified modules. Analyzes the dependence of the specified modules.
It prints the module descriptor, the resulting module dependences after It prints the module descriptor, the resulting module dependences after
analysis and the graph after transition reduction. analysis and the graph after transition reduction.
It also identifies any unused qualified exports. It also identifies any unused qualified exports.
.RS
.RE
.TP .TP
.B \f[CB]\-\-list\-deps\f[R] \f[V]--list-deps\f[R]
Lists the module dependences and also the package names of JDK internal Lists the module dependences and also the package names of JDK internal
APIs (if referenced). APIs (if referenced).
This option transitively analyzes libraries on class path and module This option transitively analyzes libraries on class path and module
path if referenced. path if referenced.
Use \f[CB]\-\-no\-recursive\f[R] option for non\-transitive dependency Use \f[V]--no-recursive\f[R] option for non-transitive dependency
analysis. analysis.
.RS
.RE
.TP .TP
.B \f[CB]\-\-list\-reduced\-deps\f[R] \f[V]--list-reduced-deps\f[R]
Same as \f[CB]\-\-list\-deps\f[R] without listing the implied reads edges Same as \f[V]--list-deps\f[R] without listing the implied reads edges
from the module graph. from the module graph.
If module M1 reads M2, and M2 requires transitive on M3, then M1 reading If module M1 reads M2, and M2 requires transitive on M3, then M1 reading
M3 is implied and is not shown in the graph. M3 is implied and is not shown in the graph.
.RS
.RE
.TP .TP
.B \f[CB]\-\-print\-module\-deps\f[R] \f[V]--print-module-deps\f[R]
Same as \f[CB]\-\-list\-reduced\-deps\f[R] with printing a Same as \f[V]--list-reduced-deps\f[R] with printing a comma-separated
comma\-separated list of module dependences. list of module dependences.
The output can be used by \f[CB]jlink\ \-\-add\-modules\f[R] to create a The output can be used by \f[V]jlink --add-modules\f[R] to create a
custom image that contains those modules and their transitive custom image that contains those modules and their transitive
dependences. dependences.
.RS
.RE
.TP .TP
.B \f[CB]\-\-ignore\-missing\-deps\f[R] \f[V]--ignore-missing-deps\f[R]
Ignore missing dependences. Ignore missing dependences.
.RS
.RE
.SH OPTIONS TO FILTER DEPENDENCES .SH OPTIONS TO FILTER DEPENDENCES
.TP .TP
.B \f[CB]\-p\f[R] \f[I]pkg_name\f[R], \f[CB]\-package\f[R] \f[I]pkg_name\f[R], or \f[CB]\-\-package\f[R] \f[I]pkg_name\f[R] \f[V]-p\f[R] \f[I]pkg_name\f[R], \f[V]-package\f[R] \f[I]pkg_name\f[R], or \f[V]--package\f[R] \f[I]pkg_name\f[R]
Finds dependences matching the specified package name. Finds dependences matching the specified package name.
You can specify this option multiple times for different packages. You can specify this option multiple times for different packages.
The \f[CB]\-p\f[R] and \f[CB]\-e\f[R] options are mutually exclusive. The \f[V]-p\f[R] and \f[V]-e\f[R] options are mutually exclusive.
.RS
.RE
.TP .TP
.B \f[CB]\-e\f[R] \f[I]regex\f[R], \f[CB]\-regex\f[R] \f[I]regex\f[R], or \f[CB]\-\-regex\f[R] \f[I]regex\f[R] \f[V]-e\f[R] \f[I]regex\f[R], \f[V]-regex\f[R] \f[I]regex\f[R], or \f[V]--regex\f[R] \f[I]regex\f[R]
Finds dependences matching the specified pattern. Finds dependences matching the specified pattern.
The \f[CB]\-p\f[R] and \f[CB]\-e\f[R] options are mutually exclusive. The \f[V]-p\f[R] and \f[V]-e\f[R] options are mutually exclusive.
.RS
.RE
.TP .TP
.B \f[CB]\-\-require\f[R] \f[I]module\-name\f[R] \f[V]--require\f[R] \f[I]module-name\f[R]
Finds dependences matching the given module name (may be given multiple Finds dependences matching the given module name (may be given multiple
times). times).
The \f[CB]\-\-package\f[R], \f[CB]\-\-regex\f[R], and \f[CB]\-\-require\f[R] The \f[V]--package\f[R], \f[V]--regex\f[R], and \f[V]--require\f[R]
options are mutually exclusive. options are mutually exclusive.
.RS
.RE
.TP .TP
.B \f[CB]\-f\f[R] \f[I]regex\f[R] or \f[CB]\-filter\f[R] \f[I]regex\f[R] \f[V]-f\f[R] \f[I]regex\f[R] or \f[V]-filter\f[R] \f[I]regex\f[R]
Filters dependences matching the given pattern. Filters dependences matching the given pattern.
If give multiple times, the last one will be selected. If give multiple times, the last one will be selected.
.RS
.RE
.TP .TP
.B \f[CB]\-filter:package\f[R] \f[V]-filter:package\f[R]
Filters dependences within the same package. Filters dependences within the same package.
This is the default. This is the default.
.RS
.RE
.TP .TP
.B \f[CB]\-filter:archive\f[R] \f[V]-filter:archive\f[R]
Filters dependences within the same archive. Filters dependences within the same archive.
.RS
.RE
.TP .TP
.B \f[CB]\-filter:module\f[R] \f[V]-filter:module\f[R]
Filters dependences within the same module. Filters dependences within the same module.
.RS
.RE
.TP .TP
.B \f[CB]\-filter:none\f[R] \f[V]-filter:none\f[R]
No \f[CB]\-filter:package\f[R] and \f[CB]\-filter:archive\f[R] filtering. No \f[V]-filter:package\f[R] and \f[V]-filter:archive\f[R] filtering.
Filtering specified via the \f[CB]\-filter\f[R] option still applies. Filtering specified via the \f[V]-filter\f[R] option still applies.
.RS
.RE
.TP .TP
.B \f[CB]\-\-missing\-deps\f[R] \f[V]--missing-deps\f[R]
Finds missing dependences. Finds missing dependences.
This option cannot be used with \f[CB]\-p\f[R], \f[CB]\-e\f[R] and This option cannot be used with \f[V]-p\f[R], \f[V]-e\f[R] and
\f[CB]\-s\f[R] options. \f[V]-s\f[R] options.
.RS
.RE
.SH OPTIONS TO FILTER CLASSES TO BE ANALYZED .SH OPTIONS TO FILTER CLASSES TO BE ANALYZED
.TP .TP
.B \f[CB]\-include\f[R] \f[I]regex\f[R] \f[V]-include\f[R] \f[I]regex\f[R]
Restricts analysis to the classes matching pattern. Restricts analysis to the classes matching pattern.
This option filters the list of classes to be analyzed. This option filters the list of classes to be analyzed.
It can be used together with \f[CB]\-p\f[R] and \f[CB]\-e\f[R], which apply It can be used together with \f[V]-p\f[R] and \f[V]-e\f[R], which apply
the pattern to the dependencies. the pattern to the dependencies.
.RS
.RE
.TP .TP
.B \f[CB]\-P\f[R] or \f[CB]\-profile\f[R] \f[V]-P\f[R] or \f[V]-profile\f[R]
Shows the profile containing a package. Shows the profile containing a package.
.RS
.RE
.TP .TP
.B \f[CB]\-R\f[R] or \f[CB]\-\-recursive\f[R] \f[V]-R\f[R] or \f[V]--recursive\f[R]
Recursively traverses all run\-time dependences. Recursively traverses all run-time dependences.
The \f[CB]\-R\f[R] option implies \f[CB]\-filter:none\f[R]. The \f[V]-R\f[R] option implies \f[V]-filter:none\f[R].
If \f[CB]\-p\f[R], \f[CB]\-e\f[R], or \f[CB]\-f\f[R] options are specified, If \f[V]-p\f[R], \f[V]-e\f[R], or \f[V]-f\f[R] options are specified,
only the matching dependences are analyzed. only the matching dependences are analyzed.
.RS
.RE
.TP .TP
.B \f[CB]\-\-no\-recursive\f[R] \f[V]--no-recursive\f[R]
Do not recursively traverse dependences. Do not recursively traverse dependences.
.RS
.RE
.TP .TP
.B \f[CB]\-I\f[R] or \f[CB]\-\-inverse\f[R] \f[V]-I\f[R] or \f[V]--inverse\f[R]
Analyzes the dependences per other given options and then finds all Analyzes the dependences per other given options and then finds all
artifacts that directly and indirectly depend on the matching nodes. artifacts that directly and indirectly depend on the matching nodes.
This is equivalent to the inverse of the compile\-time view analysis and This is equivalent to the inverse of the compile-time view analysis and
the print dependency summary. the print dependency summary.
This option must be used with the \f[CB]\-\-require\f[R], This option must be used with the \f[V]--require\f[R],
\f[CB]\-\-package\f[R], or \f[CB]\-\-regex\f[R] options. \f[V]--package\f[R], or \f[V]--regex\f[R] options.
.RS
.RE
.TP .TP
.B \f[CB]\-\-compile\-time\f[R] \f[V]--compile-time\f[R]
Analyzes the compile\-time view of transitive dependencies, such as the Analyzes the compile-time view of transitive dependencies, such as the
compile\-time view of the \f[CB]\-R\f[R] option. compile-time view of the \f[V]-R\f[R] option.
Analyzes the dependences per other specified options. Analyzes the dependences per other specified options.
If a dependency is found from a directory, a JAR file or a module, all If a dependency is found from a directory, a JAR file or a module, all
classes in that containing archive are analyzed. classes in that containing archive are analyzed.
.RS
.RE
.SH EXAMPLE OF ANALYZING DEPENDENCIES .SH EXAMPLE OF ANALYZING DEPENDENCIES
.PP .PP
The following example demonstrates analyzing the dependencies of the The following example demonstrates analyzing the dependencies of the
\f[CB]Notepad.jar\f[R] file. \f[V]Notepad.jar\f[R] file.
.PP .PP
\f[B]Linux and OS X:\f[R] \f[B]Linux and OS X:\f[R]
.IP .IP
.nf .nf
\f[CB] \f[CB]
$\ jdeps\ demo/jfc/Notepad/Notepad.jar $ jdeps demo/jfc/Notepad/Notepad.jar
Notepad.jar\ \->\ java.base Notepad.jar -> java.base
Notepad.jar\ \->\ java.desktop Notepad.jar -> java.desktop
Notepad.jar\ \->\ java.logging Notepad.jar -> java.logging
\ \ \ <unnamed>\ (Notepad.jar) <unnamed> (Notepad.jar)
\ \ \ \ \ \ \->\ java.awt -> java.awt
\ \ \ \ \ \ \->\ java.awt.event -> java.awt.event
\ \ \ \ \ \ \->\ java.beans -> java.beans
\ \ \ \ \ \ \->\ java.io -> java.io
\ \ \ \ \ \ \->\ java.lang -> java.lang
\ \ \ \ \ \ \->\ java.net -> java.net
\ \ \ \ \ \ \->\ java.util -> java.util
\ \ \ \ \ \ \->\ java.util.logging -> java.util.logging
\ \ \ \ \ \ \->\ javax.swing -> javax.swing
\ \ \ \ \ \ \->\ javax.swing.border -> javax.swing.border
\ \ \ \ \ \ \->\ javax.swing.event -> javax.swing.event
\ \ \ \ \ \ \->\ javax.swing.text -> javax.swing.text
\ \ \ \ \ \ \->\ javax.swing.tree -> javax.swing.tree
\ \ \ \ \ \ \->\ javax.swing.undo -> javax.swing.undo
\f[R] \f[R]
.fi .fi
.PP .PP
@ -367,37 +305,37 @@ Notepad.jar\ \->\ java.logging
.IP .IP
.nf .nf
\f[CB] \f[CB]
C:\\Java\\jdk1.9.0>jdeps\ demo\\jfc\\Notepad\\Notepad.jar C:\[rs]Java\[rs]jdk1.9.0>jdeps demo\[rs]jfc\[rs]Notepad\[rs]Notepad.jar
Notepad.jar\ \->\ java.base Notepad.jar -> java.base
Notepad.jar\ \->\ java.desktop Notepad.jar -> java.desktop
Notepad.jar\ \->\ java.logging Notepad.jar -> java.logging
\ \ \ <unnamed>\ (Notepad.jar) <unnamed> (Notepad.jar)
\ \ \ \ \ \ \->\ java.awt -> java.awt
\ \ \ \ \ \ \->\ java.awt.event -> java.awt.event
\ \ \ \ \ \ \->\ java.beans -> java.beans
\ \ \ \ \ \ \->\ java.io -> java.io
\ \ \ \ \ \ \->\ java.lang -> java.lang
\ \ \ \ \ \ \->\ java.net -> java.net
\ \ \ \ \ \ \->\ java.util -> java.util
\ \ \ \ \ \ \->\ java.util.logging -> java.util.logging
\ \ \ \ \ \ \->\ javax.swing -> javax.swing
\ \ \ \ \ \ \->\ javax.swing.border -> javax.swing.border
\ \ \ \ \ \ \->\ javax.swing.event -> javax.swing.event
\ \ \ \ \ \ \->\ javax.swing.text -> javax.swing.text
\ \ \ \ \ \ \->\ javax.swing.tree -> javax.swing.tree
\ \ \ \ \ \ \->\ javax.swing.undo -> javax.swing.undo
\f[R] \f[R]
.fi .fi
.SH EXAMPLE USING THE \-\-INVERSE OPTION .SH EXAMPLE USING THE --INVERSE OPTION
.IP .IP
.nf .nf
\f[CB] \f[CB]
\ $\ jdeps\ \-\-inverse\ \-\-require\ java.xml.bind $ jdeps --inverse --require java.xml.bind
Inverse\ transitive\ dependences\ on\ [java.xml.bind] Inverse transitive dependences on [java.xml.bind]
java.xml.bind\ <\-\ java.se.ee java.xml.bind <- java.se.ee
java.xml.bind\ <\-\ jdk.xml.ws java.xml.bind <- jdk.xml.ws
java.xml.bind\ <\-\ java.xml.ws\ <\-\ java.se.ee java.xml.bind <- java.xml.ws <- java.se.ee
java.xml.bind\ <\-\ java.xml.ws\ <\-\ jdk.xml.ws java.xml.bind <- java.xml.ws <- jdk.xml.ws
java.xml.bind\ <\-\ jdk.xml.bind\ <\-\ jdk.xml.ws java.xml.bind <- jdk.xml.bind <- jdk.xml.ws
\f[R] \f[R]
.fi .fi

View file

@ -19,40 +19,48 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JDB" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JDB" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jdb \- find and fix bugs in Java platform programs jdb - find and fix bugs in Java platform programs
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jdb\f[R] [\f[I]options\f[R]] [\f[I]classname\f[R]] \f[V]jdb\f[R] [\f[I]options\f[R]] [\f[I]classname\f[R]]
[\f[I]arguments\f[R]] [\f[I]arguments\f[R]]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
This represents the \f[CB]jdb\f[R] command\-line options. This represents the \f[V]jdb\f[R] command-line options.
See \f[B]Options for the jdb command\f[R]. See \f[B]Options for the jdb command\f[R].
.RS
.RE
.TP .TP
.B \f[I]classname\f[R] \f[I]classname\f[R]
This represents the name of the main class to debug. This represents the name of the main class to debug.
.RS
.RE
.TP .TP
.B \f[I]arguments\f[R] \f[I]arguments\f[R]
This represents the arguments that are passed to the \f[CB]main()\f[R] This represents the arguments that are passed to the \f[V]main()\f[R]
method of the class. method of the class.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The Java Debugger (JDB) is a simple command\-line debugger for Java The Java Debugger (JDB) is a simple command-line debugger for Java
classes. classes.
The \f[CB]jdb\f[R] command and its options call the JDB. The \f[V]jdb\f[R] command and its options call the JDB.
The \f[CB]jdb\f[R] command demonstrates the Java Platform Debugger The \f[V]jdb\f[R] command demonstrates the Java Platform Debugger
Architecture and provides inspection and debugging of a local or remote Architecture and provides inspection and debugging of a local or remote
JVM. JVM.
.SH START A JDB SESSION .SH START A JDB SESSION
@ -60,45 +68,45 @@ JVM.
There are many ways to start a JDB session. There are many ways to start a JDB session.
The most frequently used way is to have the JDB launch a new JVM with The most frequently used way is to have the JDB launch a new JVM with
the main class of the application to be debugged. the main class of the application to be debugged.
Do this by substituting the \f[CB]jdb\f[R] command for the \f[CB]java\f[R] Do this by substituting the \f[V]jdb\f[R] command for the \f[V]java\f[R]
command in the command line. command in the command line.
For example, if your application\[aq]s main class is \f[CB]MyClass\f[R], For example, if your application\[aq]s main class is \f[V]MyClass\f[R],
then use the following command to debug it under the JDB: then use the following command to debug it under the JDB:
.RS .RS
.PP .PP
\f[CB]jdb\ MyClass\f[R] \f[V]jdb MyClass\f[R]
.RE .RE
.PP .PP
When started this way, the \f[CB]jdb\f[R] command calls a second JVM with When started this way, the \f[V]jdb\f[R] command calls a second JVM with
the specified parameters, loads the specified class, and stops the JVM the specified parameters, loads the specified class, and stops the JVM
before executing that class\[aq]s first instruction. before executing that class\[aq]s first instruction.
.PP .PP
Another way to use the \f[CB]jdb\f[R] command is by attaching it to a JVM Another way to use the \f[V]jdb\f[R] command is by attaching it to a JVM
that\[aq]s already running. that\[aq]s already running.
Syntax for starting a JVM to which the \f[CB]jdb\f[R] command attaches Syntax for starting a JVM to which the \f[V]jdb\f[R] command attaches
when the JVM is running is as follows. when the JVM is running is as follows.
This loads in\-process debugging libraries and specifies the kind of This loads in-process debugging libraries and specifies the kind of
connection to be made. connection to be made.
.RS .RS
.PP .PP
\f[CB]java\ \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n\ MyClass\f[R] \f[V]java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\f[R]
.RE .RE
.PP .PP
You can then attach the \f[CB]jdb\f[R] command to the JVM with the You can then attach the \f[V]jdb\f[R] command to the JVM with the
following command: following command:
.RS .RS
.PP .PP
\f[CB]jdb\ \-attach\ 8000\f[R] \f[V]jdb -attach 8000\f[R]
.RE .RE
.PP .PP
8000 is the address of the running JVM. 8000 is the address of the running JVM.
.PP .PP
The \f[CB]MyClass\f[R] argument isn\[aq]t specified in the \f[CB]jdb\f[R] The \f[V]MyClass\f[R] argument isn\[aq]t specified in the \f[V]jdb\f[R]
command line in this case because the \f[CB]jdb\f[R] command is connecting command line in this case because the \f[V]jdb\f[R] command is
to an existing JVM instead of launching a new JVM. connecting to an existing JVM instead of launching a new JVM.
.PP .PP
There are many other ways to connect the debugger to a JVM, and all of There are many other ways to connect the debugger to a JVM, and all of
them are supported by the \f[CB]jdb\f[R] command. them are supported by the \f[V]jdb\f[R] command.
The Java Platform Debugger Architecture has additional documentation on The Java Platform Debugger Architecture has additional documentation on
these connection options. these connection options.
.SH BREAKPOINTS .SH BREAKPOINTS
@ -106,175 +114,139 @@ these connection options.
Breakpoints can be set in the JDB at line numbers or at the first Breakpoints can be set in the JDB at line numbers or at the first
instruction of a method, for example: instruction of a method, for example:
.IP \[bu] 2 .IP \[bu] 2
The command \f[CB]stop\ at\ MyClass:22\f[R] sets a breakpoint at the first The command \f[V]stop at MyClass:22\f[R] sets a breakpoint at the first
instruction for line 22 of the source file containing \f[CB]MyClass\f[R]. instruction for line 22 of the source file containing \f[V]MyClass\f[R].
.IP \[bu] 2 .IP \[bu] 2
The command \f[CB]stop\ in\ java.lang.String.length\f[R] sets a breakpoint The command \f[V]stop in java.lang.String.length\f[R] sets a breakpoint
at the beginning of the method \f[CB]java.lang.String.length\f[R]. at the beginning of the method \f[V]java.lang.String.length\f[R].
.IP \[bu] 2 .IP \[bu] 2
The command \f[CB]stop\ in\ MyClass.<clinit>\f[R] uses \f[CB]<clinit>\f[R] The command \f[V]stop in MyClass.<clinit>\f[R] uses \f[V]<clinit>\f[R]
to identify the static initialization code for \f[CB]MyClass\f[R]. to identify the static initialization code for \f[V]MyClass\f[R].
.PP .PP
When a method is overloaded, you must also specify its argument types so When a method is overloaded, you must also specify its argument types so
that the proper method can be selected for a breakpoint. that the proper method can be selected for a breakpoint.
For example, \f[CB]MyClass.myMethod(int,java.lang.String)\f[R] or For example, \f[V]MyClass.myMethod(int,java.lang.String)\f[R] or
\f[CB]MyClass.myMethod()\f[R]. \f[V]MyClass.myMethod()\f[R].
.PP .PP
The \f[CB]clear\f[R] command removes breakpoints using the following The \f[V]clear\f[R] command removes breakpoints using the following
syntax: \f[CB]clear\ MyClass:45\f[R]. syntax: \f[V]clear MyClass:45\f[R].
Using the \f[CB]clear\f[R] or \f[CB]stop\f[R] command with no argument Using the \f[V]clear\f[R] or \f[V]stop\f[R] command with no argument
displays a list of all breakpoints currently set. displays a list of all breakpoints currently set.
The \f[CB]cont\f[R] command continues execution. The \f[V]cont\f[R] command continues execution.
.SH STEPPING .SH STEPPING
.PP .PP
The \f[CB]step\f[R] command advances execution to the next line whether The \f[V]step\f[R] command advances execution to the next line whether
it\[aq]s in the current stack frame or a called method. it\[aq]s in the current stack frame or a called method.
The \f[CB]next\f[R] command advances execution to the next line in the The \f[V]next\f[R] command advances execution to the next line in the
current stack frame. current stack frame.
.SH EXCEPTIONS .SH EXCEPTIONS
.PP .PP
When an exception occurs for which there isn\[aq]t a \f[CB]catch\f[R] When an exception occurs for which there isn\[aq]t a \f[V]catch\f[R]
statement anywhere in the throwing thread\[aq]s call stack, the JVM statement anywhere in the throwing thread\[aq]s call stack, the JVM
typically prints an exception trace and exits. typically prints an exception trace and exits.
When running under the JDB, however, control returns to the JDB at the When running under the JDB, however, control returns to the JDB at the
offending throw. offending throw.
You can then use the \f[CB]jdb\f[R] command to diagnose the cause of the You can then use the \f[V]jdb\f[R] command to diagnose the cause of the
exception. exception.
.PP .PP
Use the \f[CB]catch\f[R] command to cause the debugged application to stop Use the \f[V]catch\f[R] command to cause the debugged application to
at other thrown exceptions, for example: stop at other thrown exceptions, for example:
\f[CB]catch\ java.io.FileNotFoundException\f[R] or \f[CB]catch\f[R] \f[V]catch java.io.FileNotFoundException\f[R] or \f[V]catch\f[R]
\f[CB]mypackage.BigTroubleException\f[R]. \f[V]mypackage.BigTroubleException\f[R].
Any exception that\[aq]s an instance of the specified class or subclass Any exception that\[aq]s an instance of the specified class or subclass
stops the application at the point where the exception is thrown. stops the application at the point where the exception is thrown.
.PP .PP
The \f[CB]ignore\f[R] command negates the effect of an earlier The \f[V]ignore\f[R] command negates the effect of an earlier
\f[CB]catch\f[R] command. \f[V]catch\f[R] command.
The \f[CB]ignore\f[R] command doesn\[aq]t cause the debugged JVM to ignore The \f[V]ignore\f[R] command doesn\[aq]t cause the debugged JVM to
specific exceptions, but only to ignore the debugger. ignore specific exceptions, but only to ignore the debugger.
.SH OPTIONS FOR THE JDB COMMAND .SH OPTIONS FOR THE JDB COMMAND
.PP .PP
When you use the \f[CB]jdb\f[R] command instead of the \f[CB]java\f[R] When you use the \f[V]jdb\f[R] command instead of the \f[V]java\f[R]
command on the command line, the \f[CB]jdb\f[R] command accepts many of command on the command line, the \f[V]jdb\f[R] command accepts many of
the same options as the \f[CB]java\f[R] command. the same options as the \f[V]java\f[R] command.
.PP .PP
The following options are accepted by the \f[CB]jdb\f[R] command: The following options are accepted by the \f[V]jdb\f[R] command:
.TP .TP
.B \f[CB]\-help\f[R] \f[V]-help\f[R]
Displays a help message. Displays a help message.
.RS
.RE
.TP .TP
.B \f[CB]\-sourcepath\f[R] \f[I]dir1\f[R]\f[CB]:\f[R]\f[I]dir2\f[R]\f[CB]:\f[R]... \f[V]-sourcepath\f[R] \f[I]dir1\f[R]\f[V]:\f[R]\f[I]dir2\f[R]\f[V]:\f[R]...
Uses the specified path to search for source files in the specified Uses the specified path to search for source files in the specified
path. path.
If this option is not specified, then use the default path of dot If this option is not specified, then use the default path of dot
(\f[CB]\&.\f[R]). (\f[V].\f[R]).
.RS
.RE
.TP .TP
.B \f[CB]\-attach\f[R] \f[I]address\f[R] \f[V]-attach\f[R] \f[I]address\f[R]
Attaches the debugger to a running JVM with the default connection Attaches the debugger to a running JVM with the default connection
mechanism. mechanism.
.RS
.RE
.TP .TP
.B \f[CB]\-listen\f[R] \f[I]address\f[R] \f[V]-listen\f[R] \f[I]address\f[R]
Waits for a running JVM to connect to the specified address with a Waits for a running JVM to connect to the specified address with a
standard connector. standard connector.
.RS
.RE
.TP .TP
.B \f[CB]\-listenany\f[R] \f[V]-listenany\f[R]
Waits for a running JVM to connect at any available address using a Waits for a running JVM to connect at any available address using a
standard connector. standard connector.
.RS
.RE
.TP .TP
.B \f[CB]\-launch\f[R] \f[V]-launch\f[R]
Starts the debugged application immediately upon startup of the Starts the debugged application immediately upon startup of the
\f[CB]jdb\f[R] command. \f[V]jdb\f[R] command.
The \f[CB]\-launch\f[R] option removes the need for the \f[CB]run\f[R] The \f[V]-launch\f[R] option removes the need for the \f[V]run\f[R]
command. command.
The debugged application is launched and then stopped just before the The debugged application is launched and then stopped just before the
initial application class is loaded. initial application class is loaded.
At that point, you can set any necessary breakpoints and use the At that point, you can set any necessary breakpoints and use the
\f[CB]cont\f[R] command to continue execution. \f[V]cont\f[R] command to continue execution.
.RS
.RE
.TP .TP
.B \f[CB]\-listconnectors\f[R] \f[V]-listconnectors\f[R]
Lists the connectors available in this JVM. Lists the connectors available in this JVM.
.RS
.RE
.TP .TP
.B \f[CB]\-connect\f[R] \f[I]connector\-name\f[R]\f[CB]:\f[R]\f[I]name1\f[R]\f[CB]=\f[R]\f[I]value1\f[R].... \f[V]-connect\f[R] \f[I]connector-name\f[R]\f[V]:\f[R]\f[I]name1\f[R]\f[V]=\f[R]\f[I]value1\f[R]....
Connects to the target JVM with the named connector and listed argument Connects to the target JVM with the named connector and listed argument
values. values.
.RS
.RE
.TP .TP
.B \f[CB]\-dbgtrace\f[R] [\f[I]flags\f[R]] \f[V]-dbgtrace\f[R] [\f[I]flags\f[R]]
Prints information for debugging the \f[CB]jdb\f[R] command. Prints information for debugging the \f[V]jdb\f[R] command.
.RS
.RE
.TP .TP
.B \f[CB]\-tclient\f[R] \f[V]-tclient\f[R]
Runs the application in the Java HotSpot VM client. Runs the application in the Java HotSpot VM client.
.RS
.RE
.TP .TP
.B \f[CB]\-trackallthreads\f[R] \f[V]-trackallthreads\f[R]
Track all threads as they are created, including virtual threads. Track all threads as they are created, including virtual threads.
See \f[B]Working With Virtual Threads\f[R] below. See \f[B]Working With Virtual Threads\f[R] below.
Virtual threads are a preview feature of the Java platform. Virtual threads are a preview feature of the Java platform.
.RS
.RE
.TP .TP
.B \f[CB]\-tserver\f[R] \f[V]-tserver\f[R]
Runs the application in the Java HotSpot VM server. Runs the application in the Java HotSpot VM server.
.RS
.RE
.TP .TP
.B \f[CB]\-J\f[R]\f[I]option\f[R] \f[V]-J\f[R]\f[I]option\f[R]
Passes \f[I]option\f[R] to the JDB JVM, where option is one of the Passes \f[I]option\f[R] to the JDB JVM, where option is one of the
options described on the reference page for the Java application options described on the reference page for the Java application
launcher. launcher.
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB. For example, \f[V]-J-Xms48m\f[R] sets the startup memory to 48 MB.
See \f[I]Overview of Java Options\f[R] in \f[B]java\f[R]. See \f[I]Overview of Java Options\f[R] in \f[B]java\f[R].
.RS
.RE
.PP .PP
The following options are forwarded to the debuggee process: The following options are forwarded to the debuggee process:
.TP .TP
.B \f[CB]\-R\f[R]\f[I]option\f[R] \f[V]-R\f[R]\f[I]option\f[R]
Passes \f[I]option\f[R] to the debuggee JVM, where option is one of the Passes \f[I]option\f[R] to the debuggee JVM, where option is one of the
options described on the reference page for the Java application options described on the reference page for the Java application
launcher. launcher.
For example, \f[CB]\-R\-Xms48m\f[R] sets the startup memory to 48 MB. For example, \f[V]-R-Xms48m\f[R] sets the startup memory to 48 MB.
See \f[I]Overview of Java Options\f[R] in \f[B]java\f[R]. See \f[I]Overview of Java Options\f[R] in \f[B]java\f[R].
.RS
.RE
.TP .TP
.B \f[CB]\-v\f[R] or \f[CB]\-verbose\f[R][\f[CB]:\f[R]\f[I]class\f[R]|\f[CB]gc\f[R]|\f[CB]jni\f[R]] \f[V]-v\f[R] or \f[V]-verbose\f[R][\f[V]:\f[R]\f[I]class\f[R]|\f[V]gc\f[R]|\f[V]jni\f[R]]
Turns on the verbose mode. Turns on the verbose mode.
.RS
.RE
.TP .TP
.B \f[CB]\-D\f[R]\f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R] \f[V]-D\f[R]\f[I]name\f[R]\f[V]=\f[R]\f[I]value\f[R]
Sets a system property. Sets a system property.
.RS
.RE
.TP .TP
.B \f[CB]\-classpath\f[R] \f[I]dir\f[R] \f[V]-classpath\f[R] \f[I]dir\f[R]
Lists directories separated by colons in which to look for classes. Lists directories separated by colons in which to look for classes.
.RS
.RE
.TP .TP
.B \f[CB]\-X\f[R] \f[I]option\f[R] \f[V]-X\f[R] \f[I]option\f[R]
A nonstandard target JVM option. A nonstandard target JVM option.
.RS
.RE
.PP .PP
Other options are supported to provide alternate mechanisms for Other options are supported to provide alternate mechanisms for
connecting the debugger to the JVM that it\[aq]s to debug. connecting the debugger to the JVM that it\[aq]s to debug.
@ -290,7 +262,7 @@ For this reason by default JDB does not keep track of virtual threads as
they are created. they are created.
It will only keep track of virtual threads that an event has arrived on, It will only keep track of virtual threads that an event has arrived on,
such as a breakpoint event. such as a breakpoint event.
The \f[CB]\-trackallthreads\f[R] option can be used to make JDB track all The \f[V]-trackallthreads\f[R] option can be used to make JDB track all
virtual threads as they are created. virtual threads as they are created.
.PP .PP
When JDB first connects, it requests a list of all known threads from When JDB first connects, it requests a list of all known threads from
@ -298,12 +270,12 @@ the Debug Agent.
By default the debug agent does not return any virtual threads in this By default the debug agent does not return any virtual threads in this
list, once again because the list could be so large that it overwhelms list, once again because the list could be so large that it overwhelms
the debugger. the debugger.
The Debug Agent has an \f[CB]includevirtualthreads\f[R] option that can be The Debug Agent has an \f[V]includevirtualthreads\f[R] option that can
enabled to change this behavior so all known virtual threads will be be enabled to change this behavior so all known virtual threads will be
included in the list. included in the list.
The JDB \f[CB]\-trackallthreads\f[R] option will cause JDB to The JDB \f[V]-trackallthreads\f[R] option will cause JDB to
automatically enable the Debug Agent\[aq]s automatically enable the Debug Agent\[aq]s
\f[CB]includevirtualthreads\f[R] option when JDB launches an application \f[V]includevirtualthreads\f[R] option when JDB launches an application
to debug. to debug.
However, keep in mind that the Debug Agent may not know about any However, keep in mind that the Debug Agent may not know about any
virtual threads that were created before JDB attached to the debugged virtual threads that were created before JDB attached to the debugged

View file

@ -19,57 +19,64 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JFR" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JFR" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jfr \- parse and print Flight Recorder files jfr - parse and print Flight Recorder files
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
To print the contents of a flight recording to standard out: To print the contents of a flight recording to standard out:
.PP .PP
\f[CB]jfr\f[R] \f[CB]print\f[R] [\f[I]options\f[R]] \f[I]file\f[R] \f[V]jfr\f[R] \f[V]print\f[R] [\f[I]options\f[R]] \f[I]file\f[R]
.PP .PP
To print metadata information about flight recording events: To print metadata information about flight recording events:
.PP .PP
\f[CB]jfr\f[R] \f[CB]metadata\f[R] \f[I]file\f[R] \f[V]jfr\f[R] \f[V]metadata\f[R] \f[I]file\f[R]
.PP .PP
To assemble chunk files into a flight recording file: To assemble chunk files into a flight recording file:
.PP .PP
\f[CB]jfr\f[R] \f[CB]assemble\f[R] \f[I]repository\f[R] \f[I]file\f[R] \f[V]jfr\f[R] \f[V]assemble\f[R] \f[I]repository\f[R] \f[I]file\f[R]
.PP .PP
To disassemble a flight recording file into chunk files: To disassemble a flight recording file into chunk files:
.PP .PP
\f[CB]jfr\f[R] \f[CB]disassmble\f[R] [\f[I]options\f[R]] \f[I]file\f[R] \f[V]jfr\f[R] \f[V]disassmble\f[R] [\f[I]options\f[R]] \f[I]file\f[R]
.PP .PP
To view the summary statistics for a flight recording file: To view the summary statistics for a flight recording file:
.PP .PP
\f[CB]jfr\f[R] \f[CB]summary\f[R] \f[I]file\f[R] \f[V]jfr\f[R] \f[V]summary\f[R] \f[I]file\f[R]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
Optional: Specifies command\-line options separated by spaces. Optional: Specifies command-line options separated by spaces.
See the individual subcomponent sections for descriptions of the See the individual subcomponent sections for descriptions of the
available options. available options.
.RS
.RE
.TP .TP
.B \f[I]file\f[R] \f[I]file\f[R]
Specifies the name of the target flight recording file Specifies the name of the target flight recording file (\f[V].jfr\f[R]).
(\f[CB]\&.jfr\f[R]).
.RS
.RE
.TP .TP
.B \f[I]repository\f[R] \f[I]repository\f[R]
Specifies the location of the chunk files which are to be assembled into Specifies the location of the chunk files which are to be assembled into
a flight recording. a flight recording.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jfr\f[R] command provides a tool for interacting with flight The \f[V]jfr\f[R] command provides a tool for interacting with flight
recorder files (\f[CB]\&.jfr\f[R]). recorder files (\f[V].jfr\f[R]).
The main function is to filter, summarize and output flight recording The main function is to filter, summarize and output flight recording
files into human readable format. files into human readable format.
There is also support for merging and splitting recording files. There is also support for merging and splitting recording files.
@ -80,77 +87,65 @@ manipulate the contents and translate them into human readable format
helps developers to debug performance issues with Java applications. helps developers to debug performance issues with Java applications.
.SS Subcommands .SS Subcommands
.PP .PP
The \f[CB]jfr\f[R] command has several subcommands: The \f[V]jfr\f[R] command has several subcommands:
.IP \[bu] 2 .IP \[bu] 2
\f[CB]print\f[R] \f[V]print\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]summary\f[R] \f[V]summary\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]assemble\f[R] \f[V]assemble\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]disassemble\f[R] \f[V]disassemble\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]metadata\f[R] \f[V]metadata\f[R]
.SS \f[CB]jfr\ print\f[R] subcommand .SS \f[V]jfr print\f[R] subcommand
.PP .PP
Use \f[CB]jfr\ print\f[R] to print the contents of a flight recording file Use \f[V]jfr print\f[R] to print the contents of a flight recording file
to standard out. to standard out.
The syntax is: The syntax is:
.PP .PP
\f[CB]jfr\ print\f[R] [\f[CB]\-\-xml\f[R]|\f[CB]\-\-json\f[R]] \f[V]jfr print\f[R] [\f[V]--xml\f[R]|\f[V]--json\f[R]]
[\f[CB]\-\-categories\f[R] <\f[I]filters\f[R]>] [\f[CB]\-\-events\f[R] [\f[V]--categories\f[R] <\f[I]filters\f[R]>] [\f[V]--events\f[R]
<\f[I]filters\f[R]>] [\f[CB]\-\-stack\-depth\f[R] <\f[I]depth\f[R]>] <\f[I]filters\f[R]>] [\f[V]--stack-depth\f[R] <\f[I]depth\f[R]>]
<\f[I]file\f[R]> <\f[I]file\f[R]>
.PP .PP
where: where:
.TP .TP
.B \f[CB]\-\-xml\f[R] \f[V]--xml\f[R]
Print the recording in XML format Print the recording in XML format
.RS
.RE
.TP .TP
.B \f[CB]\-\-json\f[R] \f[V]--json\f[R]
Print the recording in JSON format Print the recording in JSON format
.RS
.RE
.TP .TP
.B \f[CB]\-\-categories\f[R] <\f[I]filters\f[R]> \f[V]--categories\f[R] <\f[I]filters\f[R]>
Select events matching a category name. Select events matching a category name.
The filter is a comma\-separated list of names, simple and/or qualified, The filter is a comma-separated list of names, simple and/or qualified,
and/or quoted glob patterns and/or quoted glob patterns
.RS
.RE
.TP .TP
.B \f[CB]\-\-events\f[R] <\f[I]filters\f[R]> \f[V]--events\f[R] <\f[I]filters\f[R]>
Select events matching an event name. Select events matching an event name.
The filter is a comma\-separated list of names, simple and/or qualified, The filter is a comma-separated list of names, simple and/or qualified,
and/or quoted glob patterns and/or quoted glob patterns
.RS
.RE
.TP .TP
.B \f[CB]\-\-stack\-depth\f[R] <\f[I]depth\f[R]> \f[V]--stack-depth\f[R] <\f[I]depth\f[R]>
Number of frames in stack traces, by default 5 Number of frames in stack traces, by default 5
.RS
.RE
.TP .TP
.B <\f[I]file\f[R]> <\f[I]file\f[R]>
Location of the recording file (\f[CB]\&.jfr\f[R]) Location of the recording file (\f[V].jfr\f[R])
.RS
.RE
.PP .PP
The default format for printing the contents of the flight recording The default format for printing the contents of the flight recording
file is human readable form unless either \f[CB]xml\f[R] or \f[CB]json\f[R] file is human readable form unless either \f[V]xml\f[R] or
is specified. \f[V]json\f[R] is specified.
These options provide machine\-readable output that can be further These options provide machine-readable output that can be further parsed
parsed or processed by user created scripts. or processed by user created scripts.
.PP .PP
Use \f[CB]jfr\ \-\-help\ print\f[R] to see example usage of filters. Use \f[V]jfr --help print\f[R] to see example usage of filters.
.PP .PP
To reduce the amount of data displayed, it is possible to filter out To reduce the amount of data displayed, it is possible to filter out
events or categories of events. events or categories of events.
The filter operates on the symbolic name of an event, set by using the The filter operates on the symbolic name of an event, set by using the
\f[CB]\@Name\f[R] annotation, or the category name, set by using the \f[V]\[at]Name\f[R] annotation, or the category name, set by using the
\f[CB]\@Category\f[R] annotation. \f[V]\[at]Category\f[R] annotation.
If multiple filters are used, events from both filters will be included. If multiple filters are used, events from both filters will be included.
If no filter is used, all the events will be printed. If no filter is used, all the events will be printed.
If a combination of a category filter and event filter is used, the If a combination of a category filter and event filter is used, the
@ -159,19 +154,19 @@ selected events will be the union of the two filters.
For example, to show all GC events and the CPULoad event, the following For example, to show all GC events and the CPULoad event, the following
command could be used: command could be used:
.PP .PP
\f[CB]jfr\ print\ \-\-categories\ GC\ \-\-events\ CPULoad\ recording.jfr\f[R] \f[V]jfr print --categories GC --events CPULoad recording.jfr\f[R]
.PP .PP
Event values are formatted according to the content types that are being Event values are formatted according to the content types that are being
used. used.
For example, a field with the \f[CB]jdk.jfr.Percentage\f[R] annotation For example, a field with the \f[V]jdk.jfr.Percentage\f[R] annotation
that has the value 0.52 is formatted as 52%. that has the value 0.52 is formatted as 52%.
.PP .PP
Stack traces are by default truncated to 5 frames, but the number can be Stack traces are by default truncated to 5 frames, but the number can be
increased/decreased using the \f[CB]\-\-stack\-depth\f[R] command\-line increased/decreased using the \f[V]--stack-depth\f[R] command-line
option. option.
.SS \f[CB]jfr\ summary\f[R] subcommand .SS \f[V]jfr summary\f[R] subcommand
.PP .PP
Use \f[CB]jfr\ summary\f[R] to print statistics for a recording. Use \f[V]jfr summary\f[R] to print statistics for a recording.
For example, a summary can illustrate the number of recorded events and For example, a summary can illustrate the number of recorded events and
how much disk space they used. how much disk space they used.
This is useful for troubleshooting and understanding the impact of event This is useful for troubleshooting and understanding the impact of event
@ -179,117 +174,102 @@ settings.
.PP .PP
The syntax is: The syntax is:
.PP .PP
\f[CB]jfr\ summary\f[R] <\f[I]file\f[R]> \f[V]jfr summary\f[R] <\f[I]file\f[R]>
.PP .PP
where: where:
.TP .TP
.B <\f[I]file\f[R]> <\f[I]file\f[R]>
Location of the flight recording file (\f[CB]\&.jfr\f[R]) Location of the flight recording file (\f[V].jfr\f[R])
.RS .SS \f[V]jfr metadata\f[R] subcommand
.RE
.SS \f[CB]jfr\ metadata\f[R] subcommand
.PP .PP
Use \f[CB]jfr\ metadata\f[R] to view information about events, such as Use \f[V]jfr metadata\f[R] to view information about events, such as
event names, categories and field layout within a flight recording file. event names, categories and field layout within a flight recording file.
The syntax is: The syntax is:
.PP .PP
\f[CB]jfr\ metadata\f[R] <\f[I]file\f[R]> \f[V]jfr metadata\f[R] <\f[I]file\f[R]>
.PP .PP
where: where:
.TP .TP
.B <\f[I]file\f[R]> <\f[I]file\f[R]>
Location of the flight recording file (\f[CB]\&.jfr\f[R]) Location of the flight recording file (\f[V].jfr\f[R])
.RS .SS jfr \f[V]assemble\f[R] subcommand
.RE
.SS jfr \f[CB]assemble\f[R] subcommand
.PP .PP
Use jfr \f[CB]assemble\f[R] to assemble chunk files into a recording file. Use jfr \f[V]assemble\f[R] to assemble chunk files into a recording
file.
.PP .PP
The syntax is: The syntax is:
.PP .PP
\f[CB]jfr\ assemble\f[R] <\f[I]repository\f[R]> <\f[I]file\f[R]> \f[V]jfr assemble\f[R] <\f[I]repository\f[R]> <\f[I]file\f[R]>
.PP .PP
where: where:
.TP .TP
.B <\f[I]repository\f[R]> <\f[I]repository\f[R]>
Directory where the repository containing chunk files is located Directory where the repository containing chunk files is located
.RS
.RE
.TP .TP
.B <\f[I]file\f[R]> <\f[I]file\f[R]>
Location of the flight recording file (\f[CB]\&.jfr\f[R]) Location of the flight recording file (\f[V].jfr\f[R])
.RS
.RE
.PP .PP
Flight recording information is written in chunks. Flight recording information is written in chunks.
A chunk contains all of the information necessary for parsing. A chunk contains all of the information necessary for parsing.
A chunk typically contains events useful for troubleshooting. A chunk typically contains events useful for troubleshooting.
If a JVM should crash, these chunks can be recovered and used to create If a JVM should crash, these chunks can be recovered and used to create
a flight recording file using this \f[CB]jfr\ assemble\f[R] command. a flight recording file using this \f[V]jfr assemble\f[R] command.
These chunk files are concatenated in chronological order and chunk These chunk files are concatenated in chronological order and chunk
files that are not finished (.part) are excluded. files that are not finished (.part) are excluded.
.SS \f[CB]jfr\ disassemble\f[R] subcommand .SS \f[V]jfr disassemble\f[R] subcommand
.PP .PP
Use \f[CB]jfr\ disassemble\f[R] to decompose a flight recording file into Use \f[V]jfr disassemble\f[R] to decompose a flight recording file into
its chunk file pieces. its chunk file pieces.
The syntax is: The syntax is:
.PP .PP
\f[CB]jfr\ disassemble\f[R] [\f[CB]\-\-max\-chunks\f[R] <\f[I]chunks\f[R]>] \f[V]jfr disassemble\f[R] [\f[V]--max-chunks\f[R] <\f[I]chunks\f[R]>]
[\f[CB]\-\-output\f[R] <\f[I]directory\f[R]>] <\f[I]file\f[R]> [\f[V]--output\f[R] <\f[I]directory\f[R]>] <\f[I]file\f[R]>
.PP .PP
where: where:
.TP .TP
.B \f[CB]\-\-output\f[R] <\f[I]directory\f[R]> \f[V]--output\f[R] <\f[I]directory\f[R]>
The location to write the disassembled file, by default the current The location to write the disassembled file, by default the current
directory directory
.RS
.RE
.TP .TP
.B \f[CB]\-\-max\-chunks\f[R] <\f[I]chunks\f[R]> \f[V]--max-chunks\f[R] <\f[I]chunks\f[R]>
Maximum number of chunks per file, by default 5. Maximum number of chunks per file, by default 5.
The chunk size varies, but is typically around 15 MB. The chunk size varies, but is typically around 15 MB.
.RS
.RE
.TP .TP
.B \f[CB]\-\-max\-size\f[R] <\f[I]size\f[R]> \f[V]--max-size\f[R] <\f[I]size\f[R]>
Maximum number of bytes per file. Maximum number of bytes per file.
.RS
.RE
.TP .TP
.B <\f[I]file\f[R]> <\f[I]file\f[R]>
Location of the flight recording file (\f[CB]\&.jfr\f[R]) Location of the flight recording file (\f[V].jfr\f[R])
.RS
.RE
.PP .PP
This function can be useful for repairing a broken file by removing the This function can be useful for repairing a broken file by removing the
faulty chunk. faulty chunk.
It can also be used to reduce the size of a file that is too large to It can also be used to reduce the size of a file that is too large to
transfer. transfer.
The resulting chunk files are named \f[CB]myfile_1.jfr\f[R], The resulting chunk files are named \f[V]myfile_1.jfr\f[R],
\f[CB]myfile_2.jfr\f[R], etc. \f[V]myfile_2.jfr\f[R], etc.
If needed, the resulting file names will be padded with zeros to If needed, the resulting file names will be padded with zeros to
preserve chronological order. preserve chronological order.
For example, the chunk file name is \f[CB]myfile_001.jfr\f[R] if the For example, the chunk file name is \f[V]myfile_001.jfr\f[R] if the
recording consists of more than 100 chunks. recording consists of more than 100 chunks.
.SS jfr version and help subcommands .SS jfr version and help subcommands
.PP .PP
Use \f[CB]jfr\ \-\-version\f[R] or \f[CB]jfr\ version\f[R] to view the Use \f[V]jfr --version\f[R] or \f[V]jfr version\f[R] to view the version
version string information for this jfr command. string information for this jfr command.
.PP .PP
To get help on any of the jfr subcommands, use: To get help on any of the jfr subcommands, use:
.PP .PP
\f[CB]jfr\ <\-\-help|help>\f[R] [\f[I]subcommand\f[R]] \f[V]jfr <--help|help>\f[R] [\f[I]subcommand\f[R]]
.PP .PP
where: where:
.PP .PP
[\f[I]subcommand\f[R]] is any of: [\f[I]subcommand\f[R]] is any of:
.IP \[bu] 2 .IP \[bu] 2
\f[CB]print\f[R] \f[V]print\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]metadata\f[R] \f[V]metadata\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]summary\f[R] \f[V]summary\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]assemble\f[R] \f[V]assemble\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]disassemble\f[R] \f[V]disassemble\f[R]

View file

@ -19,41 +19,49 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JLINK" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JLINK" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jlink \- assemble and optimize a set of modules and their dependencies jlink - assemble and optimize a set of modules and their dependencies
into a custom runtime image into a custom runtime image
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jlink\f[R] [\f[I]options\f[R]] \f[CB]\-\-module\-path\f[R] \f[V]jlink\f[R] [\f[I]options\f[R]] \f[V]--module-path\f[R]
\f[I]modulepath\f[R] \f[CB]\-\-add\-modules\f[R] \f[I]module\f[R] [, \f[I]modulepath\f[R] \f[V]--add-modules\f[R] \f[I]module\f[R] [,
\f[I]module\f[R]...] \f[I]module\f[R]...]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
Command\-line options separated by spaces. Command-line options separated by spaces.
See \f[B]jlink Options\f[R]. See \f[B]jlink Options\f[R].
.RS
.RE
.TP .TP
.B \f[I]modulepath\f[R] \f[I]modulepath\f[R]
The path where the \f[CB]jlink\f[R] tool discovers observable modules. The path where the \f[V]jlink\f[R] tool discovers observable modules.
These modules can be modular JAR files, JMOD files, or exploded modules. These modules can be modular JAR files, JMOD files, or exploded modules.
.RS
.RE
.TP .TP
.B \f[I]module\f[R] \f[I]module\f[R]
The names of the modules to add to the runtime image. The names of the modules to add to the runtime image.
The \f[CB]jlink\f[R] tool adds these modules and their transitive The \f[V]jlink\f[R] tool adds these modules and their transitive
dependencies. dependencies.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jlink\f[R] tool links a set of modules, along with their The \f[V]jlink\f[R] tool links a set of modules, along with their
transitive dependences, to create a custom runtime image. transitive dependences, to create a custom runtime image.
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
@ -61,120 +69,90 @@ transitive dependences, to create a custom runtime image.
Developers are responsible for updating their custom runtime images. Developers are responsible for updating their custom runtime images.
.SH JLINK OPTIONS .SH JLINK OPTIONS
.TP .TP
.B \f[CB]\-\-add\-modules\f[R] \f[I]mod\f[R] [\f[CB],\f[R] \f[I]mod\f[R]...] \f[V]--add-modules\f[R] \f[I]mod\f[R] [\f[V],\f[R] \f[I]mod\f[R]...]
Adds the named modules, \f[I]mod\f[R], to the default set of root Adds the named modules, \f[I]mod\f[R], to the default set of root
modules. modules.
The default set of root modules is empty. The default set of root modules is empty.
.RS
.RE
.TP .TP
.B \f[CB]\-\-bind\-services\f[R] \f[V]--bind-services\f[R]
Link service provider modules and their dependencies. Link service provider modules and their dependencies.
.RS
.RE
.TP .TP
.B \f[CB]\-c\ ={0|1|2}\f[R] or \f[CB]\-\-compress={0|1|2}\f[R] \f[V]-c ={0|1|2}\f[R] or \f[V]--compress={0|1|2}\f[R]
Enable compression of resources: Enable compression of resources:
.RS .RS
.IP \[bu] 2 .IP \[bu] 2
\f[CB]0\f[R]: No compression \f[V]0\f[R]: No compression
.IP \[bu] 2 .IP \[bu] 2
\f[CB]1\f[R]: Constant string sharing \f[V]1\f[R]: Constant string sharing
.IP \[bu] 2 .IP \[bu] 2
\f[CB]2\f[R]: ZIP \f[V]2\f[R]: ZIP
.RE .RE
.TP .TP
.B \f[CB]\-\-disable\-plugin\f[R] \f[I]pluginname\f[R] \f[V]--disable-plugin\f[R] \f[I]pluginname\f[R]
Disables the specified plug\-in. Disables the specified plug-in.
See \f[B]jlink Plug\-ins\f[R] for the list of supported plug\-ins. See \f[B]jlink Plug-ins\f[R] for the list of supported plug-ins.
.RS
.RE
.TP .TP
.B \f[CB]\-\-endian\f[R] {\f[CB]little\f[R]|\f[CB]big\f[R]} \f[V]--endian\f[R] {\f[V]little\f[R]|\f[V]big\f[R]}
Specifies the byte order of the generated image. Specifies the byte order of the generated image.
The default value is the format of your system\[aq]s architecture. The default value is the format of your system\[aq]s architecture.
.RS
.RE
.TP .TP
.B \f[CB]\-h\f[R] or \f[CB]\-\-help\f[R] \f[V]-h\f[R] or \f[V]--help\f[R]
Prints the help message. Prints the help message.
.RS
.RE
.TP .TP
.B \f[CB]\-\-ignore\-signing\-information\f[R] \f[V]--ignore-signing-information\f[R]
Suppresses a fatal error when signed modular JARs are linked in the Suppresses a fatal error when signed modular JARs are linked in the
runtime image. runtime image.
The signature\-related files of the signed modular JARs aren\[aq]t The signature-related files of the signed modular JARs aren\[aq]t copied
copied to the runtime image. to the runtime image.
.RS
.RE
.TP .TP
.B \f[CB]\-\-launcher\f[R] \f[I]command\f[R]\f[CB]=\f[R]\f[I]module\f[R] or \f[CB]\-\-launcher\f[R] \f[I]command\f[R]\f[CB]=\f[R]\f[I]module\f[R]\f[CB]/\f[R]\f[I]main\f[R] \f[V]--launcher\f[R] \f[I]command\f[R]\f[V]=\f[R]\f[I]module\f[R] or \f[V]--launcher\f[R] \f[I]command\f[R]\f[V]=\f[R]\f[I]module\f[R]\f[V]/\f[R]\f[I]main\f[R]
Specifies the launcher command name for the module or the command name Specifies the launcher command name for the module or the command name
for the module and main class (the module and the main class names are for the module and main class (the module and the main class names are
separated by a slash (\f[CB]/\f[R])). separated by a slash (\f[V]/\f[R])).
.RS
.RE
.TP .TP
.B \f[CB]\-\-limit\-modules\f[R] \f[I]mod\f[R] [\f[CB],\f[R] \f[I]mod\f[R]...] \f[V]--limit-modules\f[R] \f[I]mod\f[R] [\f[V],\f[R] \f[I]mod\f[R]...]
Limits the universe of observable modules to those in the transitive Limits the universe of observable modules to those in the transitive
closure of the named modules, \f[CB]mod\f[R], plus the main module, if closure of the named modules, \f[V]mod\f[R], plus the main module, if
any, plus any further modules specified in the \f[CB]\-\-add\-modules\f[R] any, plus any further modules specified in the \f[V]--add-modules\f[R]
option. option.
.RS
.RE
.TP .TP
.B \f[CB]\-\-list\-plugins\f[R] \f[V]--list-plugins\f[R]
Lists available plug\-ins, which you can access through command\-line Lists available plug-ins, which you can access through command-line
options; see \f[B]jlink Plug\-ins\f[R]. options; see \f[B]jlink Plug-ins\f[R].
.RS
.RE
.TP .TP
.B \f[CB]\-p\f[R] or \f[CB]\-\-module\-path\f[R] \f[I]modulepath\f[R] \f[V]-p\f[R] or \f[V]--module-path\f[R] \f[I]modulepath\f[R]
Specifies the module path. Specifies the module path.
.RS .RS
.PP .PP
If this option is not specified, then the default module path is If this option is not specified, then the default module path is
\f[CB]$JAVA_HOME/jmods\f[R]. \f[V]$JAVA_HOME/jmods\f[R].
This directory contains the \f[CB]java.base\f[R] module and the other This directory contains the \f[V]java.base\f[R] module and the other
standard and JDK modules. standard and JDK modules.
If this option is specified but the \f[CB]java.base\f[R] module cannot be If this option is specified but the \f[V]java.base\f[R] module cannot be
resolved from it, then the \f[CB]jlink\f[R] command appends resolved from it, then the \f[V]jlink\f[R] command appends
\f[CB]$JAVA_HOME/jmods\f[R] to the module path. \f[V]$JAVA_HOME/jmods\f[R] to the module path.
.RE .RE
.TP .TP
.B \f[CB]\-\-no\-header\-files\f[R] \f[V]--no-header-files\f[R]
Excludes header files. Excludes header files.
.RS
.RE
.TP .TP
.B \f[CB]\-\-no\-man\-pages\f[R] \f[V]--no-man-pages\f[R]
Excludes man pages. Excludes man pages.
.RS
.RE
.TP .TP
.B \f[CB]\-\-output\f[R] \f[I]path\f[R] \f[V]--output\f[R] \f[I]path\f[R]
Specifies the location of the generated runtime image. Specifies the location of the generated runtime image.
.RS
.RE
.TP .TP
.B \f[CB]\-\-save\-opts\f[R] \f[I]filename\f[R] \f[V]--save-opts\f[R] \f[I]filename\f[R]
Saves \f[CB]jlink\f[R] options in the specified file. Saves \f[V]jlink\f[R] options in the specified file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-suggest\-providers\f[R] [\f[I]name\f[R]\f[CB],\f[R] ...] \f[V]--suggest-providers\f[R] [\f[I]name\f[R]\f[V],\f[R] ...]
Suggest providers that implement the given service types from the module Suggest providers that implement the given service types from the module
path. path.
.RS
.RE
.TP .TP
.B \f[CB]\-\-version\f[R] \f[V]--version\f[R]
Prints version information. Prints version information.
.RS
.RE
.TP .TP
.B \f[CB]\@\f[R]\f[I]filename\f[R] \f[V]\[at]\f[R]\f[I]filename\f[R]
Reads options from the specified file. Reads options from the specified file.
.RS .RS
.PP .PP
@ -182,55 +160,53 @@ An options file is a text file that contains the options and values that
you would typically enter in a command prompt. you would typically enter in a command prompt.
Options may appear on one line or on several lines. Options may appear on one line or on several lines.
You may not specify environment variables for path names. You may not specify environment variables for path names.
You may comment out lines by prefixing a hash symbol (\f[CB]#\f[R]) to the You may comment out lines by prefixing a hash symbol (\f[V]#\f[R]) to
beginning of the line. the beginning of the line.
.PP .PP
The following is an example of an options file for the \f[CB]jlink\f[R] The following is an example of an options file for the \f[V]jlink\f[R]
command: command:
.IP .IP
.nf .nf
\f[CB] \f[CB]
#Wed\ Dec\ 07\ 00:40:19\ EST\ 2016 #Wed Dec 07 00:40:19 EST 2016
\-\-module\-path\ mlib --module-path mlib
\-\-add\-modules\ com.greetings --add-modules com.greetings
\-\-output\ greetingsapp --output greetingsapp
\f[R] \f[R]
.fi .fi
.RE .RE
.SH JLINK PLUG\-INS .SH JLINK PLUG-INS
.PP .PP
\f[B]Note:\f[R] \f[B]Note:\f[R]
.PP .PP
Plug\-ins not listed in this section aren\[aq]t supported and are Plug-ins not listed in this section aren\[aq]t supported and are subject
subject to change. to change.
.PP .PP
For plug\-in options that require a \f[I]pattern\-list\f[R], the value is For plug-in options that require a \f[I]pattern-list\f[R], the value is
a comma\-separated list of elements, with each element using one the a comma-separated list of elements, with each element using one the
following forms: following forms:
.IP \[bu] 2 .IP \[bu] 2
\f[I]glob\-pattern\f[R] \f[I]glob-pattern\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]glob:\f[R]\f[I]glob\-pattern\f[R] \f[V]glob:\f[R]\f[I]glob-pattern\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]regex:\f[R]\f[I]regex\-pattern\f[R] \f[V]regex:\f[R]\f[I]regex-pattern\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]\@\f[R]\f[I]filename\f[R] \f[V]\[at]\f[R]\f[I]filename\f[R]
.RS 2 .RS 2
.IP \[bu] 2 .IP \[bu] 2
\f[I]filename\f[R] is the name of a file that contains patterns to be \f[I]filename\f[R] is the name of a file that contains patterns to be
used, one pattern per line. used, one pattern per line.
.RE .RE
.PP .PP
For a complete list of all available plug\-ins, run the command For a complete list of all available plug-ins, run the command
\f[CB]jlink\ \-\-list\-plugins\f[R]. \f[V]jlink --list-plugins\f[R].
.SS Plugin \f[CB]compress\f[R] .SS Plugin \f[V]compress\f[R]
.TP .TP
.B Options Options
\f[CB]\-\-compress=\f[R]{\f[CB]0\f[R]|\f[CB]1\f[R]|\f[CB]2\f[R]}[\f[CB]:filter=\f[R]\f[I]pattern\-list\f[R]] \f[V]--compress=\f[R]{\f[V]0\f[R]|\f[V]1\f[R]|\f[V]2\f[R]}[\f[V]:filter=\f[R]\f[I]pattern-list\f[R]]
.RS
.RE
.TP .TP
.B Description Description
Compresses all resources in the output image. Compresses all resources in the output image.
.RS .RS
.IP \[bu] 2 .IP \[bu] 2
@ -240,19 +216,17 @@ Level 1: Constant string sharing
.IP \[bu] 2 .IP \[bu] 2
Level 2: ZIP Level 2: ZIP
.PP .PP
An optional \f[I]pattern\-list\f[R] filter can be specified to list the An optional \f[I]pattern-list\f[R] filter can be specified to list the
pattern of files to include. pattern of files to include.
.RE .RE
.SS Plugin \f[CB]include\-locales\f[R] .SS Plugin \f[V]include-locales\f[R]
.TP .TP
.B Options Options
\f[CB]\-\-include\-locales=\f[R]\f[I]langtag\f[R][\f[CB],\f[R]\f[I]langtag\f[R]]* \f[V]--include-locales=\f[R]\f[I]langtag\f[R][\f[V],\f[R]\f[I]langtag\f[R]]*
.RS
.RE
.TP .TP
.B Description Description
Includes the list of locales where \f[I]langtag\f[R] is a BCP 47 language Includes the list of locales where \f[I]langtag\f[R] is a BCP 47
tag. language tag.
This option supports locale matching as defined in RFC 4647. This option supports locale matching as defined in RFC 4647.
Ensure that you add the module jdk.localedata when using this option. Ensure that you add the module jdk.localedata when using this option.
.RS .RS
@ -260,74 +234,64 @@ Ensure that you add the module jdk.localedata when using this option.
Example: Example:
.RS .RS
.PP .PP
\f[CB]\-\-add\-modules\ jdk.localedata\ \-\-include\-locales=en,ja,*\-IN\f[R] \f[V]--add-modules jdk.localedata --include-locales=en,ja,*-IN\f[R]
.RE .RE
.RE .RE
.SS Plugin \f[CB]order\-resources\f[R] .SS Plugin \f[V]order-resources\f[R]
.TP .TP
.B Options Options
\f[CB]\-\-order\-resources=\f[R]\f[I]pattern\-list\f[R] \f[V]--order-resources=\f[R]\f[I]pattern-list\f[R]
.RS
.RE
.TP .TP
.B Description Description
Orders the specified paths in priority order. Orders the specified paths in priority order.
If \f[CB]\@\f[R]\f[I]filename\f[R] is specified, then each line in If \f[V]\[at]\f[R]\f[I]filename\f[R] is specified, then each line in
\f[I]pattern\-list\f[R] must be an exact match for the paths to be \f[I]pattern-list\f[R] must be an exact match for the paths to be
ordered. ordered.
.RS .RS
.PP .PP
Example: Example:
.RS .RS
.PP .PP
\f[CB]\-\-order\-resources=/module\-info.class,\@classlist,/java.base/java/lang/\f[R] \f[V]--order-resources=/module-info.class,\[at]classlist,/java.base/java/lang/\f[R]
.RE .RE
.RE .RE
.SS Plugin \f[CB]strip\-debug\f[R] .SS Plugin \f[V]strip-debug\f[R]
.TP .TP
.B Options Options
\f[CB]\-\-strip\-debug\f[R] \f[V]--strip-debug\f[R]
.RS
.RE
.TP .TP
.B Description Description
Strips debug information from the output image. Strips debug information from the output image.
.RS .SS Plugin \f[V]generate-cds-archive\f[R]
.RE
.SS Plugin \f[CB]generate\-cds\-archive\f[R]
.TP .TP
.B Options Options
\f[CB]\-\-generate\-cds\-archive\f[R] \f[V]--generate-cds-archive\f[R]
.RS
.RE
.TP .TP
.B Description Description
Generate CDS archive if the runtime image supports the CDS feature. Generate CDS archive if the runtime image supports the CDS feature.
.RS
.RE
.SH JLINK EXAMPLES .SH JLINK EXAMPLES
.PP .PP
The following command creates a runtime image in the directory The following command creates a runtime image in the directory
\f[CB]greetingsapp\f[R]. \f[V]greetingsapp\f[R].
This command links the module \f[CB]com.greetings\f[R], whose module This command links the module \f[V]com.greetings\f[R], whose module
definition is contained in the directory \f[CB]mlib\f[R]. definition is contained in the directory \f[V]mlib\f[R].
.IP .IP
.nf .nf
\f[CB] \f[CB]
jlink\ \-\-module\-path\ mlib\ \-\-add\-modules\ com.greetings\ \-\-output\ greetingsapp jlink --module-path mlib --add-modules com.greetings --output greetingsapp
\f[R] \f[R]
.fi .fi
.PP .PP
The following command lists the modules in the runtime image The following command lists the modules in the runtime image
\f[CB]greetingsapp\f[R]: \f[V]greetingsapp\f[R]:
.IP .IP
.nf .nf
\f[CB] \f[CB]
greetingsapp/bin/java\ \-\-list\-modules greetingsapp/bin/java --list-modules
com.greetings com.greetings
java.base\@11 java.base\[at]11
java.logging\@11 java.logging\[at]11
org.astro\@1.0 org.astro\[at]1.0
\f[R] \f[R]
.fi .fi
.PP .PP
@ -337,64 +301,64 @@ reduce space, and includes French language locale information:
.IP .IP
.nf .nf
\f[CB] \f[CB]
jlink\ \-\-add\-modules\ jdk.localedata\ \-\-strip\-debug\ \-\-compress=2\ \-\-include\-locales=fr\ \-\-output\ compressedrt jlink --add-modules jdk.localedata --strip-debug --compress=2 --include-locales=fr --output compressedrt
\f[R] \f[R]
.fi .fi
.PP .PP
The following example compares the size of the runtime image The following example compares the size of the runtime image
\f[CB]compressedrt\f[R] with \f[CB]fr_rt\f[R], which isn\[aq]t stripped of \f[V]compressedrt\f[R] with \f[V]fr_rt\f[R], which isn\[aq]t stripped of
debug symbols and doesn\[aq]t use compression: debug symbols and doesn\[aq]t use compression:
.IP .IP
.nf .nf
\f[CB] \f[CB]
jlink\ \-\-add\-modules\ jdk.localedata\ \-\-include\-locales=fr\ \-\-output\ fr_rt jlink --add-modules jdk.localedata --include-locales=fr --output fr_rt
du\ \-sh\ ./compressedrt\ ./fr_rt du -sh ./compressedrt ./fr_rt
23M\ \ \ \ \ ./compressedrt 23M ./compressedrt
36M\ \ \ \ \ ./fr_rt 36M ./fr_rt
\f[R] \f[R]
.fi .fi
.PP .PP
The following example lists the providers that implement The following example lists the providers that implement
\f[CB]java.security.Provider\f[R]: \f[V]java.security.Provider\f[R]:
.IP .IP
.nf .nf
\f[CB] \f[CB]
jlink\ \-\-suggest\-providers\ java.security.Provider jlink --suggest-providers java.security.Provider
Suggested\ providers: Suggested providers:
\ \ java.naming\ provides\ java.security.Provider\ used\ by\ java.base java.naming provides java.security.Provider used by java.base
\ \ java.security.jgss\ provides\ java.security.Provider\ used\ by\ java.base java.security.jgss provides java.security.Provider used by java.base
\ \ java.security.sasl\ provides\ java.security.Provider\ used\ by\ java.base java.security.sasl provides java.security.Provider used by java.base
\ \ java.smartcardio\ provides\ java.security.Provider\ used\ by\ java.base java.smartcardio provides java.security.Provider used by java.base
\ \ java.xml.crypto\ provides\ java.security.Provider\ used\ by\ java.base java.xml.crypto provides java.security.Provider used by java.base
\ \ jdk.crypto.cryptoki\ provides\ java.security.Provider\ used\ by\ java.base jdk.crypto.cryptoki provides java.security.Provider used by java.base
\ \ jdk.crypto.ec\ provides\ java.security.Provider\ used\ by\ java.base jdk.crypto.ec provides java.security.Provider used by java.base
\ \ jdk.crypto.mscapi\ provides\ java.security.Provider\ used\ by\ java.base jdk.crypto.mscapi provides java.security.Provider used by java.base
\ \ jdk.security.jgss\ provides\ java.security.Provider\ used\ by\ java.base jdk.security.jgss provides java.security.Provider used by java.base
\f[R] \f[R]
.fi .fi
.PP .PP
The following example creates a custom runtime image named The following example creates a custom runtime image named
\f[CB]mybuild\f[R] that includes only \f[CB]java.naming\f[R] and \f[V]mybuild\f[R] that includes only \f[V]java.naming\f[R] and
\f[CB]jdk.crypto.cryptoki\f[R] and their dependencies but no other \f[V]jdk.crypto.cryptoki\f[R] and their dependencies but no other
providers. providers.
Note that these dependencies must exist in the module path: Note that these dependencies must exist in the module path:
.IP .IP
.nf .nf
\f[CB] \f[CB]
jlink\ \-\-add\-modules\ java.naming,jdk.crypto.cryptoki\ \-\-output\ mybuild jlink --add-modules java.naming,jdk.crypto.cryptoki --output mybuild
\f[R] \f[R]
.fi .fi
.PP .PP
The following command is similar to the one that creates a runtime image The following command is similar to the one that creates a runtime image
named \f[CB]greetingsapp\f[R], except that it will link the modules named \f[V]greetingsapp\f[R], except that it will link the modules
resolved from root modules with service binding; see the resolved from root modules with service binding; see the
\f[B]\f[BC]Configuration.resolveAndBind\f[B]\f[R] method. \f[B]\f[VB]Configuration.resolveAndBind\f[B]\f[R] method.
.IP .IP
.nf .nf
\f[CB] \f[CB]
jlink\ \-\-module\-path\ mlib\ \-\-add\-modules\ com.greetings\ \-\-output\ greetingsapp\ \-\-bind\-services jlink --module-path mlib --add-modules com.greetings --output greetingsapp --bind-services
\f[R] \f[R]
.fi .fi
.PP .PP
@ -403,43 +367,43 @@ greetingsapp created by this command:
.IP .IP
.nf .nf
\f[CB] \f[CB]
greetingsapp/bin/java\ \-\-list\-modules greetingsapp/bin/java --list-modules
com.greetings com.greetings
java.base\@11 java.base\[at]11
java.compiler\@11 java.compiler\[at]11
java.datatransfer\@11 java.datatransfer\[at]11
java.desktop\@11 java.desktop\[at]11
java.logging\@11 java.logging\[at]11
java.management\@11 java.management\[at]11
java.management.rmi\@11 java.management.rmi\[at]11
java.naming\@11 java.naming\[at]11
java.prefs\@11 java.prefs\[at]11
java.rmi\@11 java.rmi\[at]11
java.security.jgss\@11 java.security.jgss\[at]11
java.security.sasl\@11 java.security.sasl\[at]11
java.smartcardio\@11 java.smartcardio\[at]11
java.xml\@11 java.xml\[at]11
java.xml.crypto\@11 java.xml.crypto\[at]11
jdk.accessibility\@11 jdk.accessibility\[at]11
jdk.charsets\@11 jdk.charsets\[at]11
jdk.compiler\@11 jdk.compiler\[at]11
jdk.crypto.cryptoki\@11 jdk.crypto.cryptoki\[at]11
jdk.crypto.ec\@11 jdk.crypto.ec\[at]11
jdk.crypto.mscapi\@11 jdk.crypto.mscapi\[at]11
jdk.internal.opt\@11 jdk.internal.opt\[at]11
jdk.jartool\@11 jdk.jartool\[at]11
jdk.javadoc\@11 jdk.javadoc\[at]11
jdk.jdeps\@11 jdk.jdeps\[at]11
jdk.jfr\@11 jdk.jfr\[at]11
jdk.jlink\@11 jdk.jlink\[at]11
jdk.localedata\@11 jdk.localedata\[at]11
jdk.management\@11 jdk.management\[at]11
jdk.management.jfr\@11 jdk.management.jfr\[at]11
jdk.naming.dns\@11 jdk.naming.dns\[at]11
jdk.naming.rmi\@11 jdk.naming.rmi\[at]11
jdk.security.auth\@11 jdk.security.auth\[at]11
jdk.security.jgss\@11 jdk.security.jgss\[at]11
jdk.zipfs\@11 jdk.zipfs\[at]11
org.astro\@1.0 org.astro\[at]1.0
\f[R] \f[R]
.fi .fi

View file

@ -1,4 +1,4 @@
.\" Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. .\" Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\" .\"
.\" This code is free software; you can redistribute it and/or modify it .\" This code is free software; you can redistribute it and/or modify it
@ -19,219 +19,190 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JMOD" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JMOD" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jmod \- create JMOD files and list the content of existing JMOD files jmod - create JMOD files and list the content of existing JMOD files
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[CB]jmod\f[R] \f[V]jmod\f[R]
(\f[CB]create\f[R]|\f[CB]extract\f[R]|\f[CB]list\f[R]|\f[CB]describe\f[R]|\f[CB]hash\f[R]) (\f[V]create\f[R]|\f[V]extract\f[R]|\f[V]list\f[R]|\f[V]describe\f[R]|\f[V]hash\f[R])
[\f[I]options\f[R]] \f[I]jmod\-file\f[R] [\f[I]options\f[R]] \f[I]jmod-file\f[R]
.PP .PP
Includes the following: Includes the following:
.PP .PP
\f[B]Main operation modes\f[R] \f[B]Main operation modes\f[R]
.TP .TP
.B \f[CB]create\f[R] \f[V]create\f[R]
Creates a new JMOD archive file. Creates a new JMOD archive file.
.RS
.RE
.TP .TP
.B \f[CB]extract\f[R] \f[V]extract\f[R]
Extracts all the files from the JMOD archive file. Extracts all the files from the JMOD archive file.
.RS
.RE
.TP .TP
.B \f[CB]list\f[R] \f[V]list\f[R]
Prints the names of all the entries. Prints the names of all the entries.
.RS
.RE
.TP .TP
.B \f[CB]describe\f[R] \f[V]describe\f[R]
Prints the module details. Prints the module details.
.RS
.RE
.TP .TP
.B \f[CB]hash\f[R] \f[V]hash\f[R]
Determines leaf modules and records the hashes of the dependencies that Determines leaf modules and records the hashes of the dependencies that
directly and indirectly require them. directly and indirectly require them.
.RS
.RE
.PP .PP
\f[B]Options\f[R] \f[B]Options\f[R]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
See \f[B]Options for jmod\f[R]. See \f[B]Options for jmod\f[R].
.RS
.RE
.PP .PP
\f[B]Required\f[R] \f[B]Required\f[R]
.TP .TP
.B \f[I]jmod\-file\f[R] \f[I]jmod-file\f[R]
Specifies the name of the JMOD file to create or from which to retrieve Specifies the name of the JMOD file to create or from which to retrieve
information. information.
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\f[B]Note:\f[R] For most development tasks, including deploying modules \f[B]Note:\f[R] For most development tasks, including deploying modules
on the module path or publishing them to a Maven repository, continue to on the module path or publishing them to a Maven repository, continue to
package modules in modular JAR files. package modules in modular JAR files.
The \f[CB]jmod\f[R] tool is intended for modules that have native The \f[V]jmod\f[R] tool is intended for modules that have native
libraries or other configuration files or for modules that you intend to libraries or other configuration files or for modules that you intend to
link, with the \f[B]jlink\f[R] tool, to a runtime image. link, with the \f[B]jlink\f[R] tool, to a runtime image.
.PP .PP
The JMOD file format lets you aggregate files other than The JMOD file format lets you aggregate files other than
\f[CB]\&.class\f[R] files, metadata, and resources. \f[V].class\f[R] files, metadata, and resources.
This format is transportable but not executable, which means that you This format is transportable but not executable, which means that you
can use it during compile time or link time but not at run time. can use it during compile time or link time but not at run time.
.PP .PP
Many \f[CB]jmod\f[R] options involve specifying a path whose contents are Many \f[V]jmod\f[R] options involve specifying a path whose contents are
copied into the resulting JMOD files. copied into the resulting JMOD files.
These options copy all the contents of the specified path, including These options copy all the contents of the specified path, including
subdirectories and their contents, but exclude files whose names match subdirectories and their contents, but exclude files whose names match
the pattern specified by the \f[CB]\-\-exclude\f[R] option. the pattern specified by the \f[V]--exclude\f[R] option.
.PP .PP
With the \f[CB]\-\-hash\-modules\f[R] option or the \f[CB]jmod\ hash\f[R] With the \f[V]--hash-modules\f[R] option or the \f[V]jmod hash\f[R]
command, you can, in each module\[aq]s descriptor, record hashes of the command, you can, in each module\[aq]s descriptor, record hashes of the
content of the modules that are allowed to depend upon it, thus "tying" content of the modules that are allowed to depend upon it, thus
together these modules. \[dq]tying\[dq] together these modules.
This enables a package to be exported to one or more specifically\-named This enables a package to be exported to one or more specifically-named
modules and to no others through qualified exports. modules and to no others through qualified exports.
The runtime verifies if the recorded hash of a module matches the one The runtime verifies if the recorded hash of a module matches the one
resolved at run time; if not, the runtime returns an error. resolved at run time; if not, the runtime returns an error.
.SH OPTIONS FOR JMOD .SH OPTIONS FOR JMOD
.TP .TP
.B \f[CB]\-\-class\-path\f[R] \f[I]path\f[R] \f[V]--class-path\f[R] \f[I]path\f[R]
Specifies the location of application JAR files or a directory Specifies the location of application JAR files or a directory
containing classes to copy into the resulting JMOD file. containing classes to copy into the resulting JMOD file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-cmds\f[R] \f[I]path\f[R] \f[V]--cmds\f[R] \f[I]path\f[R]
Specifies the location of native commands to copy into the resulting Specifies the location of native commands to copy into the resulting
JMOD file. JMOD file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-config\f[R] \f[I]path\f[R] \f[V]--compress\f[R] \f[I]compress\f[R]
Specifies the location of user\-editable configuration files to copy Specifies the compression to use in creating the JMOD file.
into the resulting JMOD file. The accepted values are \f[V]zip-[0-9]\f[R], where \f[V]zip-0\f[R]
.RS provides no compression, and \f[V]zip-9\f[R] provides the best
.RE compression.
Default is \f[V]zip-6\f[R].
.TP .TP
.B \f[CB]\-\-date\f[R]\f[I]TIMESTAMP\f[R] \f[V]--config\f[R] \f[I]path\f[R]
The timestamp in ISO\-8601 extended offset date\-time with optional Specifies the location of user-editable configuration files to copy into
time\-zone format, to use for the timestamp of the entries, e.g. the resulting JMOD file.
"2022\-02\-12T12:30:00\-05:00".
.RS
.RE
.TP .TP
.B \f[CB]\-\-dir\f[R] \f[I]path\f[R] \f[V]--date\f[R]\f[I]TIMESTAMP\f[R]
Specifies the location where \f[CB]jmod\f[R] puts extracted files from the The timestamp in ISO-8601 extended offset date-time with optional
specified JMOD archive. time-zone format, to use for the timestamp of the entries, e.g.
.RS \[dq]2022-02-12T12:30:00-05:00\[dq].
.RE
.TP .TP
.B \f[CB]\-\-dry\-run\f[R] \f[V]--dir\f[R] \f[I]path\f[R]
Specifies the location where \f[V]jmod\f[R] puts extracted files from
the specified JMOD archive.
.TP
\f[V]--dry-run\f[R]
Performs a dry run of hash mode. Performs a dry run of hash mode.
It identifies leaf modules and their required modules without recording It identifies leaf modules and their required modules without recording
any hash values. any hash values.
.RS
.RE
.TP .TP
.B \f[CB]\-\-exclude\f[R] \f[I]pattern\-list\f[R] \f[V]--exclude\f[R] \f[I]pattern-list\f[R]
Excludes files matching the supplied comma\-separated pattern list, each Excludes files matching the supplied comma-separated pattern list, each
element using one the following forms: element using one the following forms:
.RS .RS
.IP \[bu] 2 .IP \[bu] 2
\f[I]glob\-pattern\f[R] \f[I]glob-pattern\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]glob:\f[R]\f[I]glob\-pattern\f[R] \f[V]glob:\f[R]\f[I]glob-pattern\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]regex:\f[R]\f[I]regex\-pattern\f[R] \f[V]regex:\f[R]\f[I]regex-pattern\f[R]
.PP .PP
See the \f[B]\f[BC]FileSystem.getPathMatcher\f[B]\f[R] method for the See the \f[B]\f[VB]FileSystem.getPathMatcher\f[B]\f[R] method for the
syntax of \f[I]glob\-pattern\f[R]. syntax of \f[I]glob-pattern\f[R].
See the \f[B]\f[BC]Pattern\f[B]\f[R] class for the syntax of See the \f[B]\f[VB]Pattern\f[B]\f[R] class for the syntax of
\f[I]regex\-pattern\f[R], which represents a regular expression. \f[I]regex-pattern\f[R], which represents a regular expression.
.RE .RE
.TP .TP
.B \f[CB]\-\-hash\-modules\f[R] \f[I]regex\-pattern\f[R] \f[V]--hash-modules\f[R] \f[I]regex-pattern\f[R]
Determines the leaf modules and records the hashes of the dependencies Determines the leaf modules and records the hashes of the dependencies
directly and indirectly requiring them, based on the module graph of the directly and indirectly requiring them, based on the module graph of the
modules matching the given \f[I]regex\-pattern\f[R]. modules matching the given \f[I]regex-pattern\f[R].
The hashes are recorded in the JMOD archive file being created, or a The hashes are recorded in the JMOD archive file being created, or a
JMOD archive or modular JAR on the module path specified by the JMOD archive or modular JAR on the module path specified by the
\f[CB]jmod\ hash\f[R] command. \f[V]jmod hash\f[R] command.
.RS
.RE
.TP .TP
.B \f[CB]\-\-header\-files\f[R] \f[I]path\f[R] \f[V]--header-files\f[R] \f[I]path\f[R]
Specifies the location of header files to copy into the resulting JMOD Specifies the location of header files to copy into the resulting JMOD
file. file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-help\f[R] or \f[CB]\-h\f[R] \f[V]--help\f[R] or \f[V]-h\f[R]
Prints a usage message. Prints a usage message.
.RS
.RE
.TP .TP
.B \f[CB]\-\-help\-extra\f[R] \f[V]--help-extra\f[R]
Prints help for extra options. Prints help for extra options.
.RS
.RE
.TP .TP
.B \f[CB]\-\-legal\-notices\f[R] \f[I]path\f[R] \f[V]--legal-notices\f[R] \f[I]path\f[R]
Specifies the location of legal notices to copy into the resulting JMOD Specifies the location of legal notices to copy into the resulting JMOD
file. file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-libs\f[R] \f[I]path\f[R] \f[V]--libs\f[R] \f[I]path\f[R]
Specifies location of native libraries to copy into the resulting JMOD Specifies location of native libraries to copy into the resulting JMOD
file. file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-main\-class\f[R] \f[I]class\-name\f[R] \f[V]--main-class\f[R] \f[I]class-name\f[R]
Specifies main class to record in the module\-info.class file. Specifies main class to record in the module-info.class file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-man\-pages\f[R] \f[I]path\f[R] \f[V]--man-pages\f[R] \f[I]path\f[R]
Specifies the location of man pages to copy into the resulting JMOD Specifies the location of man pages to copy into the resulting JMOD
file. file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-module\-version\f[R] \f[I]module\-version\f[R] \f[V]--module-version\f[R] \f[I]module-version\f[R]
Specifies the module version to record in the module\-info.class file. Specifies the module version to record in the module-info.class file.
.RS
.RE
.TP .TP
.B \f[CB]\-\-module\-path\f[R] \f[I]path\f[R] or \f[CB]\-p\f[R] \f[I]path\f[R] \f[V]--module-path\f[R] \f[I]path\f[R] or \f[V]-p\f[R] \f[I]path\f[R]
Specifies the module path. Specifies the module path.
This option is required if you also specify \f[CB]\-\-hash\-modules\f[R]. This option is required if you also specify \f[V]--hash-modules\f[R].
.RS
.RE
.TP .TP
.B \f[CB]\-\-target\-platform\f[R] \f[I]platform\f[R] \f[V]--target-platform\f[R] \f[I]platform\f[R]
Specifies the target platform. Specifies the target platform.
.RS
.RE
.TP .TP
.B \f[CB]\-\-version\f[R] \f[V]--version\f[R]
Prints version information of the \f[CB]jmod\f[R] tool. Prints version information of the \f[V]jmod\f[R] tool.
.RS
.RE
.TP .TP
.B \f[CB]\@\f[R]\f[I]filename\f[R] \f[V]\[at]\f[R]\f[I]filename\f[R]
Reads options from the specified file. Reads options from the specified file.
.RS .RS
.PP .PP
@ -239,21 +210,21 @@ An options file is a text file that contains the options and values that
you would ordinarily enter in a command prompt. you would ordinarily enter in a command prompt.
Options may appear on one line or on several lines. Options may appear on one line or on several lines.
You may not specify environment variables for path names. You may not specify environment variables for path names.
You may comment out lines by prefixinga hash symbol (\f[CB]#\f[R]) to the You may comment out lines by prefixinga hash symbol (\f[V]#\f[R]) to the
beginning of the line. beginning of the line.
.PP .PP
The following is an example of an options file for the \f[CB]jmod\f[R] The following is an example of an options file for the \f[V]jmod\f[R]
command: command:
.IP .IP
.nf .nf
\f[CB] \f[CB]
#Wed\ Dec\ 07\ 00:40:19\ EST\ 2016 #Wed Dec 07 00:40:19 EST 2016
create\ \-\-class\-path\ mods/com.greetings\ \-\-module\-path\ mlib create --class-path mods/com.greetings --module-path mlib
\ \ \-\-cmds\ commands\ \-\-config\ configfiles\ \-\-header\-files\ src/h --cmds commands --config configfiles --header-files src/h
\ \ \-\-libs\ lib\ \-\-main\-class\ com.greetings.Main --libs lib --main-class com.greetings.Main
\ \ \-\-man\-pages\ man\ \-\-module\-version\ 1.0 --man-pages man --module-version 1.0
\ \ \-\-os\-arch\ "x86_x64"\ \-\-os\-name\ "Mac\ OS\ X" --os-arch \[dq]x86_x64\[dq] --os-name \[dq]Mac OS X\[dq]
\ \ \-\-os\-version\ "10.10.5"\ greetingsmod --os-version \[dq]10.10.5\[dq] greetingsmod
\f[R] \f[R]
.fi .fi
.RE .RE
@ -262,90 +233,86 @@ create\ \-\-class\-path\ mods/com.greetings\ \-\-module\-path\ mlib
In addition to the options described in \f[B]Options for jmod\f[R], the In addition to the options described in \f[B]Options for jmod\f[R], the
following are extra options that can be used with the command. following are extra options that can be used with the command.
.TP .TP
.B \f[CB]\-\-do\-not\-resolve\-by\-default\f[R] \f[V]--do-not-resolve-by-default\f[R]
Exclude from the default root set of modules Exclude from the default root set of modules
.RS
.RE
.TP .TP
.B \f[CB]\-\-warn\-if\-resolved\f[R] \f[V]--warn-if-resolved\f[R]
Hint for a tool to issue a warning if the module is resolved. Hint for a tool to issue a warning if the module is resolved.
One of deprecated, deprecated\-for\-removal, or incubating. One of deprecated, deprecated-for-removal, or incubating.
.RS
.RE
.SH JMOD CREATE EXAMPLE .SH JMOD CREATE EXAMPLE
.PP .PP
The following is an example of creating a JMOD file: The following is an example of creating a JMOD file:
.IP .IP
.nf .nf
\f[CB] \f[CB]
jmod\ create\ \-\-class\-path\ mods/com.greetings\ \-\-cmds\ commands jmod create --class-path mods/com.greetings --cmds commands
\ \ \-\-config\ configfiles\ \-\-header\-files\ src/h\ \-\-libs\ lib --config configfiles --header-files src/h --libs lib
\ \ \-\-main\-class\ com.greetings.Main\ \-\-man\-pages\ man\ \-\-module\-version\ 1.0 --main-class com.greetings.Main --man-pages man --module-version 1.0
\ \ \-\-os\-arch\ "x86_x64"\ \-\-os\-name\ "Mac\ OS\ X" --os-arch \[dq]x86_x64\[dq] --os-name \[dq]Mac OS X\[dq]
\ \ \-\-os\-version\ "10.10.5"\ greetingsmod --os-version \[dq]10.10.5\[dq] greetingsmod
\f[R] \f[R]
.fi .fi
.PP .PP
Create a JMOD file specifying the date for the entries as Create a JMOD file specifying the date for the entries as
\f[CB]2022\ March\ 15\ 00:00:00\f[R]: \f[V]2022 March 15 00:00:00\f[R]:
.IP .IP
.nf .nf
\f[CB] \f[CB]
jmod\ create\ \-\-class\-path\ build/foo/classes\ \-\-date\ 2022\-03\-15T00:00:00Z jmod create --class-path build/foo/classes --date 2022-03-15T00:00:00Z
\ \ \ jmods/foo1.jmod jmods/foo1.jmod
\f[R] \f[R]
.fi .fi
.SH JMOD HASH EXAMPLE .SH JMOD HASH EXAMPLE
.PP .PP
The following example demonstrates what happens when you try to link a The following example demonstrates what happens when you try to link a
leaf module (in this example, \f[CB]ma\f[R]) with a required module leaf module (in this example, \f[V]ma\f[R]) with a required module
(\f[CB]mb\f[R]), and the hash value recorded in the required module (\f[V]mb\f[R]), and the hash value recorded in the required module
doesn\[aq]t match that of the leaf module. doesn\[aq]t match that of the leaf module.
.IP "1." 3 .IP "1." 3
Create and compile the following \f[CB]\&.java\f[R] files: Create and compile the following \f[V].java\f[R] files:
.RS 4 .RS 4
.IP \[bu] 2 .IP \[bu] 2
\f[CB]jmodhashex/src/ma/module\-info.java\f[R] \f[V]jmodhashex/src/ma/module-info.java\f[R]
.RS 2 .RS 2
.IP .IP
.nf .nf
\f[CB] \f[CB]
module\ ma\ { module ma {
\ \ requires\ mb; requires mb;
} }
\f[R] \f[R]
.fi .fi
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
\f[CB]jmodhashex/src/mb/module\-info.java\f[R] \f[V]jmodhashex/src/mb/module-info.java\f[R]
.RS 2 .RS 2
.IP .IP
.nf .nf
\f[CB] \f[CB]
module\ mb\ { module mb {
} }
\f[R] \f[R]
.fi .fi
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
\f[CB]jmodhashex2/src/ma/module\-info.java\f[R] \f[V]jmodhashex2/src/ma/module-info.java\f[R]
.RS 2 .RS 2
.IP .IP
.nf .nf
\f[CB] \f[CB]
module\ ma\ { module ma {
\ \ requires\ mb; requires mb;
} }
\f[R] \f[R]
.fi .fi
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
\f[CB]jmodhashex2/src/mb/module\-info.java\f[R] \f[V]jmodhashex2/src/mb/module-info.java\f[R]
.RS 2 .RS 2
.IP .IP
.nf .nf
\f[CB] \f[CB]
module\ mb\ { module mb {
} }
\f[R] \f[R]
.fi .fi
@ -353,87 +320,87 @@ module\ mb\ {
.RE .RE
.IP "2." 3 .IP "2." 3
Create a JMOD archive for each module. Create a JMOD archive for each module.
Create the directories \f[CB]jmodhashex/jmods\f[R] and Create the directories \f[V]jmodhashex/jmods\f[R] and
\f[CB]jmodhashex2/jmods\f[R], and then run the following commands from the \f[V]jmodhashex2/jmods\f[R], and then run the following commands from
\f[CB]jmodhashex\f[R] directory, then from the \f[CB]jmodhashex2\f[R] the \f[V]jmodhashex\f[R] directory, then from the \f[V]jmodhashex2\f[R]
directory: directory:
.RS 4 .RS 4
.IP \[bu] 2 .IP \[bu] 2
\f[CB]jmod\ create\ \-\-class\-path\ mods/ma\ jmods/ma.jmod\f[R] \f[V]jmod create --class-path mods/ma jmods/ma.jmod\f[R]
.IP \[bu] 2 .IP \[bu] 2
\f[CB]jmod\ create\ \-\-class\-path\ mods/mb\ jmods/mb.jmod\f[R] \f[V]jmod create --class-path mods/mb jmods/mb.jmod\f[R]
.RE .RE
.IP "3." 3 .IP "3." 3
Optionally preview the \f[CB]jmod\ hash\f[R] command. Optionally preview the \f[V]jmod hash\f[R] command.
Run the following command from the \f[CB]jmodhashex\f[R] directory: Run the following command from the \f[V]jmodhashex\f[R] directory:
.RS 4 .RS 4
.PP .PP
\f[CB]jmod\ hash\ \-\-dry\-run\ \-module\-path\ jmods\ \-\-hash\-modules\ .*\f[R] \f[V]jmod hash --dry-run -module-path jmods --hash-modules .*\f[R]
.PP .PP
The command prints the following: The command prints the following:
.IP .IP
.nf .nf
\f[CB] \f[CB]
Dry\ run: Dry run:
mb mb
\ \ hashes\ ma\ SHA\-256\ 07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a hashes ma SHA-256 07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a
\f[R] \f[R]
.fi .fi
.PP .PP
This indicates that the \f[CB]jmod\ hash\f[R] command (without the This indicates that the \f[V]jmod hash\f[R] command (without the
\f[CB]\-\-dry\-run\f[R] option) will record the hash value of the leaf \f[V]--dry-run\f[R] option) will record the hash value of the leaf
module \f[CB]ma\f[R] in the module \f[CB]mb\f[R]. module \f[V]ma\f[R] in the module \f[V]mb\f[R].
.RE .RE
.IP "4." 3 .IP "4." 3
Record hash values in the JMOD archive files contained in the Record hash values in the JMOD archive files contained in the
\f[CB]jmodhashex\f[R] directory. \f[V]jmodhashex\f[R] directory.
Run the following command from the \f[CB]jmodhashex\f[R] directory: Run the following command from the \f[V]jmodhashex\f[R] directory:
.RS 4 .RS 4
.RS .RS
.PP .PP
\f[CB]jmod\ hash\ \-\-module\-path\ jmods\ \-\-hash\-modules\ .*\f[R] \f[V]jmod hash --module-path jmods --hash-modules .*\f[R]
.RE .RE
.PP .PP
The command prints the following: The command prints the following:
.RS .RS
.PP .PP
\f[CB]Hashes\ are\ recorded\ in\ module\ mb\f[R] \f[V]Hashes are recorded in module mb\f[R]
.RE .RE
.RE .RE
.IP "5." 3 .IP "5." 3
Print information about each JMOD archive contained in the Print information about each JMOD archive contained in the
\f[CB]jmodhashex\f[R] directory. \f[V]jmodhashex\f[R] directory.
Run the highlighted commands from the \f[CB]jmodhashex\f[R] directory: Run the highlighted commands from the \f[V]jmodhashex\f[R] directory:
.RS 4 .RS 4
.IP .IP
.nf .nf
\f[CB] \f[CB]
jmod\ describe\ jmods/ma.jmod jmod describe jmods/ma.jmod
ma ma
\ \ requires\ mandated\ java.base requires mandated java.base
\ \ requires\ mb requires mb
jmod\ describe\ jmods/mb.jmod jmod describe jmods/mb.jmod
mb mb
\ \ requires\ mandated\ java.base requires mandated java.base
\ \ hashes\ ma\ SHA\-256\ 07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a hashes ma SHA-256 07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a
\f[R] \f[R]
.fi .fi
.RE .RE
.IP "6." 3 .IP "6." 3
Attempt to create a runtime image that contains the module \f[CB]ma\f[R] Attempt to create a runtime image that contains the module \f[V]ma\f[R]
from the directory \f[CB]jmodhashex2\f[R] but the module \f[CB]mb\f[R] from from the directory \f[V]jmodhashex2\f[R] but the module \f[V]mb\f[R]
the directory \f[CB]jmodhashex\f[R]. from the directory \f[V]jmodhashex\f[R].
Run the following command from the \f[CB]jmodhashex2\f[R] directory: Run the following command from the \f[V]jmodhashex2\f[R] directory:
.RS 4 .RS 4
.IP \[bu] 2 .IP \[bu] 2
\f[B]Linux and OS X:\f[R] \f[B]Linux and OS X:\f[R]
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]jlink\ \-\-module\-path\ $JAVA_HOME/jmods:jmods/ma.jmod:../jmodhashex/jmods/mb.jmod\ \-\-add\-modules\ ma\ \-\-output\ ma\-app\f[R] \f[V]jlink --module-path $JAVA_HOME/jmods:jmods/ma.jmod:../jmodhashex/jmods/mb.jmod --add-modules ma --output ma-app\f[R]
.RE .RE
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
@ -441,7 +408,7 @@ Run the following command from the \f[CB]jmodhashex2\f[R] directory:
.RS 2 .RS 2
.RS .RS
.PP .PP
\f[CB]jlink\ \-\-module\-path\ %JAVA_HOME%/jmods;jmods/ma.jmod;../jmodhashex/jmods/mb.jmod\ \-\-add\-modules\ ma\ \-\-output\ ma\-app\f[R] \f[V]jlink --module-path %JAVA_HOME%/jmods;jmods/ma.jmod;../jmodhashex/jmods/mb.jmod --add-modules ma --output ma-app\f[R]
.RE .RE
.RE .RE
.PP .PP
@ -449,8 +416,8 @@ The command prints an error message similar to the following:
.IP .IP
.nf .nf
\f[CB] \f[CB]
Error:\ Hash\ of\ ma\ (a2d77889b0cb067df02a3abc39b01ac1151966157a68dc4241562c60499150d2)\ differs\ to Error: Hash of ma (a2d77889b0cb067df02a3abc39b01ac1151966157a68dc4241562c60499150d2) differs to
expected\ hash\ (07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a)\ recorded\ in\ mb expected hash (07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a) recorded in mb
\f[R] \f[R]
.fi .fi
.RE .RE

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -19,138 +19,141 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Automatically generated by Pandoc 2.3.1 .\" Automatically generated by Pandoc 2.19.2
.\" .\"
.TH "JSTATD" "1" "2023" "JDK 20\-ea" "JDK Commands" .\" 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 "JSTATD" "1" "2023" "JDK 20-ea" "JDK Commands"
.hy .hy
.SH NAME .SH NAME
.PP .PP
jstatd \- monitor the creation and termination of instrumented Java jstatd - monitor the creation and termination of instrumented Java
HotSpot VMs HotSpot VMs
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[B]Note:\f[R] This command is experimental and unsupported. \f[B]Note:\f[R] This command is experimental and unsupported.
.PP .PP
\f[CB]jstatd\f[R] [\f[I]options\f[R]] \f[V]jstatd\f[R] [\f[I]options\f[R]]
.TP .TP
.B \f[I]options\f[R] \f[I]options\f[R]
This represents the \f[CB]jstatd\f[R] command\-line options. This represents the \f[V]jstatd\f[R] command-line options.
See \f[B]Options for the jstatd Command\f[R]. See \f[B]Options for the jstatd Command\f[R].
.RS
.RE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \f[CB]jstatd\f[R] command is an RMI server application that monitors The \f[V]jstatd\f[R] command is an RMI server application that monitors
for the creation and termination of instrumented Java HotSpot VMs and for the creation and termination of instrumented Java HotSpot VMs and
provides an interface to enable remote monitoring tools, \f[CB]jstat\f[R] provides an interface to enable remote monitoring tools, \f[V]jstat\f[R]
and \f[CB]jps\f[R], to attach to JVMs that are running on the local host and \f[V]jps\f[R], to attach to JVMs that are running on the local host
and collect information about the JVM process. and collect information about the JVM process.
.PP .PP
The \f[CB]jstatd\f[R] server requires an RMI registry on the local host. The \f[V]jstatd\f[R] server requires an RMI registry on the local host.
The \f[CB]jstatd\f[R] server attempts to attach to the RMI registry on the The \f[V]jstatd\f[R] server attempts to attach to the RMI registry on
default port, or on the port you specify with the \f[CB]\-p\f[R] the default port, or on the port you specify with the \f[V]-p\f[R]
\f[CB]port\f[R] option. \f[V]port\f[R] option.
If an RMI registry is not found, then one is created within the If an RMI registry is not found, then one is created within the
\f[CB]jstatd\f[R] application that\[aq]s bound to the port that\[aq]s \f[V]jstatd\f[R] application that\[aq]s bound to the port that\[aq]s
indicated by the \f[CB]\-p\f[R] \f[CB]port\f[R] option or to the default RMI indicated by the \f[V]-p\f[R] \f[V]port\f[R] option or to the default
registry port when the \f[CB]\-p\f[R] \f[CB]port\f[R] option is omitted. RMI registry port when the \f[V]-p\f[R] \f[V]port\f[R] option is
omitted.
You can stop the creation of an internal RMI registry by specifying the You can stop the creation of an internal RMI registry by specifying the
\f[CB]\-nr\f[R] option. \f[V]-nr\f[R] option.
.SH OPTIONS FOR THE JSTATD COMMAND .SH OPTIONS FOR THE JSTATD COMMAND
.TP .TP
.B \f[CB]\-nr\f[R] \f[V]-nr\f[R]
This option does not attempt to create an internal RMI registry within This option does not attempt to create an internal RMI registry within
the \f[CB]jstatd\f[R] process when an existing RMI registry isn\[aq]t the \f[V]jstatd\f[R] process when an existing RMI registry isn\[aq]t
found. found.
.RS
.RE
.TP .TP
.B \f[CB]\-p\f[R] \f[I]port\f[R] \f[V]-p\f[R] \f[I]port\f[R]
This option sets the port number where the RMI registry is expected to This option sets the port number where the RMI registry is expected to
be found, or when not found, created if the \f[CB]\-nr\f[R] option be found, or when not found, created if the \f[V]-nr\f[R] option
isn\[aq]t specified. isn\[aq]t specified.
.RS
.RE
.TP .TP
.B \f[CB]\-r\f[R] \f[I]rmiport\f[R] \f[V]-r\f[R] \f[I]rmiport\f[R]
This option sets the port number to which the RMI connector is bound. This option sets the port number to which the RMI connector is bound.
If not specified a random available port is used. If not specified a random available port is used.
.RS
.RE
.TP .TP
.B \f[CB]\-n\f[R] \f[I]rminame\f[R] \f[V]-n\f[R] \f[I]rminame\f[R]
This option sets the name to which the remote RMI object is bound in the This option sets the name to which the remote RMI object is bound in the
RMI registry. RMI registry.
The default name is \f[CB]JStatRemoteHost\f[R]. The default name is \f[V]JStatRemoteHost\f[R].
If multiple \f[CB]jstatd\f[R] servers are started on the same host, then If multiple \f[V]jstatd\f[R] servers are started on the same host, then
the name of the exported RMI object for each server can be made unique the name of the exported RMI object for each server can be made unique
by specifying this option. by specifying this option.
However, doing so requires that the unique server name be included in However, doing so requires that the unique server name be included in
the monitoring client\[aq]s \f[CB]hostid\f[R] and \f[CB]vmid\f[R] strings. the monitoring client\[aq]s \f[V]hostid\f[R] and \f[V]vmid\f[R] strings.
.RS
.RE
.TP .TP
.B \f[CB]\-J\f[R]\f[I]option\f[R] \f[V]-J\f[R]\f[I]option\f[R]
This option passes a Java \f[CB]option\f[R] to the JVM, where the option This option passes a Java \f[V]option\f[R] to the JVM, where the option
is one of those described on the reference page for the Java application is one of those described on the reference page for the Java application
launcher. launcher.
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB. For example, \f[V]-J-Xms48m\f[R] sets the startup memory to 48 MB.
See \f[B]java\f[R]. See \f[B]java\f[R].
.RS
.RE
.SH SECURITY .SH SECURITY
.PP .PP
The \f[CB]jstatd\f[R] server can monitor only JVMs for which it has the The \f[V]jstatd\f[R] server can monitor only JVMs for which it has the
appropriate native access permissions. appropriate native access permissions.
Therefore, the \f[CB]jstatd\f[R] process must be running with the same Therefore, the \f[V]jstatd\f[R] process must be running with the same
user credentials as the target JVMs. user credentials as the target JVMs.
Some user credentials, such as the root user in Linux and OS X operating Some user credentials, such as the root user in Linux and OS X operating
systems, have permission to access the instrumentation exported by any systems, have permission to access the instrumentation exported by any
JVM on the system. JVM on the system.
A \f[CB]jstatd\f[R] process running with such credentials can monitor any A \f[V]jstatd\f[R] process running with such credentials can monitor any
JVM on the system, but introduces additional security concerns. JVM on the system, but introduces additional security concerns.
.PP .PP
The \f[CB]jstatd\f[R] server doesn\[aq]t provide any authentication of The \f[V]jstatd\f[R] server doesn\[aq]t provide any authentication of
remote clients. remote clients.
Therefore, running a \f[CB]jstatd\f[R] server process exposes the Therefore, running a \f[V]jstatd\f[R] server process exposes the
instrumentation export by all JVMs for which the \f[CB]jstatd\f[R] process instrumentation export by all JVMs for which the \f[V]jstatd\f[R]
has access permissions to any user on the network. process has access permissions to any user on the network.
This exposure might be undesirable in your environment, and therefore, This exposure might be undesirable in your environment, and therefore,
local security policies should be considered before you start the local security policies should be considered before you start the
\f[CB]jstatd\f[R] process, particularly in production environments or on \f[V]jstatd\f[R] process, particularly in production environments or on
networks that aren\[aq]t secure. networks that aren\[aq]t secure.
.PP .PP
For security purposes, the \f[CB]jstatd\f[R] server uses an RMI For security purposes, the \f[V]jstatd\f[R] server uses an RMI
ObjectInputFilter to allow only essential classes to be deserialized. ObjectInputFilter to allow only essential classes to be deserialized.
.PP .PP
If your security concerns can\[aq]t be addressed, then the safest action If your security concerns can\[aq]t be addressed, then the safest action
is to not run the \f[CB]jstatd\f[R] server and use the \f[CB]jstat\f[R] and is to not run the \f[V]jstatd\f[R] server and use the \f[V]jstat\f[R]
\f[CB]jps\f[R] tools locally. and \f[V]jps\f[R] tools locally.
However, when using \f[CB]jps\f[R] to get a list of instrumented JVMs, the However, when using \f[V]jps\f[R] to get a list of instrumented JVMs,
list will not include any JVMs running in docker containers. the list will not include any JVMs running in docker containers.
.SH REMOTE INTERFACE .SH REMOTE INTERFACE
.PP .PP
The interface exported by the \f[CB]jstatd\f[R] process is proprietary and The interface exported by the \f[V]jstatd\f[R] process is proprietary
guaranteed to change. and guaranteed to change.
Users and developers are discouraged from writing to this interface. Users and developers are discouraged from writing to this interface.
.SH EXAMPLES .SH EXAMPLES
.PP .PP
The following are examples of the \f[CB]jstatd\f[R] command. The following are examples of the \f[V]jstatd\f[R] command.
The \f[CB]jstatd\f[R] scripts automatically start the server in the The \f[V]jstatd\f[R] scripts automatically start the server in the
background. background.
.SH INTERNAL RMI REGISTRY .SH INTERNAL RMI REGISTRY
.PP .PP
This example shows how to start a \f[CB]jstatd\f[R] session with an This example shows how to start a \f[V]jstatd\f[R] session with an
internal RMI registry. internal RMI registry.
This example assumes that no other server is bound to the default RMI This example assumes that no other server is bound to the default RMI
registry port (port \f[CB]1099\f[R]). registry port (port \f[V]1099\f[R]).
.RS .RS
.PP .PP
\f[CB]jstatd\f[R] \f[V]jstatd\f[R]
.RE .RE
.SH EXTERNAL RMI REGISTRY .SH EXTERNAL RMI REGISTRY
.PP .PP
This example starts a \f[CB]jstatd\f[R] session with an external RMI This example starts a \f[V]jstatd\f[R] session with an external RMI
registry. registry.
.IP .IP
.nf .nf
@ -160,55 +163,55 @@ jstatd
\f[R] \f[R]
.fi .fi
.PP .PP
This example starts a \f[CB]jstatd\f[R] session with an external RMI This example starts a \f[V]jstatd\f[R] session with an external RMI
registry server on port \f[CB]2020\f[R]. registry server on port \f[V]2020\f[R].
.IP .IP
.nf .nf
\f[CB] \f[CB]
jrmiregistry\ 2020& jrmiregistry 2020&
jstatd\ \-p\ 2020 jstatd -p 2020
\f[R] \f[R]
.fi .fi
.PP .PP
This example starts a \f[CB]jstatd\f[R] session with an external RMI This example starts a \f[V]jstatd\f[R] session with an external RMI
registry server on port \f[CB]2020\f[R] and JMX connector bound to port registry server on port \f[V]2020\f[R] and JMX connector bound to port
\f[CB]2021\f[R]. \f[V]2021\f[R].
.IP .IP
.nf .nf
\f[CB] \f[CB]
jrmiregistry\ 2020& jrmiregistry 2020&
jstatd\ \-p\ 2020\ \-r\ 2021 jstatd -p 2020 -r 2021
\f[R] \f[R]
.fi .fi
.PP .PP
This example starts a \f[CB]jstatd\f[R] session with an external RMI This example starts a \f[V]jstatd\f[R] session with an external RMI
registry on port 2020 that\[aq]s bound to registry on port 2020 that\[aq]s bound to
\f[CB]AlternateJstatdServerName\f[R]. \f[V]AlternateJstatdServerName\f[R].
.IP .IP
.nf .nf
\f[CB] \f[CB]
rmiregistry\ 2020& rmiregistry 2020&
jstatd\ \-p\ 2020\ \-n\ AlternateJstatdServerName jstatd -p 2020 -n AlternateJstatdServerName
\f[R] \f[R]
.fi .fi
.SH STOP THE CREATION OF AN IN\-PROCESS RMI REGISTRY .SH STOP THE CREATION OF AN IN-PROCESS RMI REGISTRY
.PP .PP
This example starts a \f[CB]jstatd\f[R] session that doesn\[aq]t create an This example starts a \f[V]jstatd\f[R] session that doesn\[aq]t create
RMI registry when one isn\[aq]t found. an RMI registry when one isn\[aq]t found.
This example assumes an RMI registry is already running. This example assumes an RMI registry is already running.
If an RMI registry isn\[aq]t running, then an error message is If an RMI registry isn\[aq]t running, then an error message is
displayed. displayed.
.RS .RS
.PP .PP
\f[CB]jstatd\ \-nr\f[R] \f[V]jstatd -nr\f[R]
.RE .RE
.SH ENABLE RMI LOGGING .SH ENABLE RMI LOGGING
.PP .PP
This example starts a \f[CB]jstatd\f[R] session with RMI logging This example starts a \f[V]jstatd\f[R] session with RMI logging
capabilities enabled. capabilities enabled.
This technique is useful as a troubleshooting aid or for monitoring This technique is useful as a troubleshooting aid or for monitoring
server activities. server activities.
.RS .RS
.PP .PP
\f[CB]jstatd\ \-J\-Djava.rmi.server.logCalls=true\f[R] \f[V]jstatd -J-Djava.rmi.server.logCalls=true\f[R]
.RE .RE

View file

@ -71,6 +71,11 @@ public class CheckManPageOptions {
void run(String... args) throws Exception { void run(String... args) throws Exception {
var file = args.length == 0 ? findDefaultFile() : Path.of(args[0]); var file = args.length == 0 ? findDefaultFile() : Path.of(args[0]);
out.println("File: " + file); out.println("File: " + file);
out.println(Files.readAllLines(file).stream()
.filter(l -> l.contains("Automatically generated by Pandoc"))
.findFirst()
.map(l -> l.substring(l.indexOf("Auto")))
.orElse("version string not found"));
out.println(); out.println();
var manPageOptions = getManPageOptions(file); var manPageOptions = getManPageOptions(file);
@ -222,31 +227,34 @@ public class CheckManPageOptions {
// In the troff man page, options are defined in one of two forms: // In the troff man page, options are defined in one of two forms:
// 1. options delegated to javac appear in pairs of lines of the form // 1. options delegated to javac appear in pairs of lines of the form
// .IP \[bu] 2 // .IP \[bu] 2
// \f[CB]\-.... // \f[V]-....
// 2. options implemented by the tool or doclet appear in lines of the form // 2. options implemented by the tool or doclet appear in pairs of lines of the form
// .B \f[CB]\-... // .TP
// \f[V]-...
Pattern p1 = Pattern.compile("\\R" + Pattern.quote(".IP \\[bu] 2") + "\\R" + Pattern.quote("\\f[CB]\\-") + ".*"); Pattern p1 = Pattern.compile("\\R" + Pattern.quote(".IP \\[bu] 2") + "\\R" + Pattern.quote("\\f[V]-") + ".*");
Pattern p2 = Pattern.compile("\\R" + Pattern.quote(".B \\f[CB]\\-") + ".*"); Pattern p2 = Pattern.compile("\\R" + Pattern.quote(".TP") + "\\R" + Pattern.quote("\\f[V]-") + ".*");
Pattern outer = Pattern.compile("(" + p1.pattern() + "|" + p2.pattern() + ")"); Pattern outer = Pattern.compile("(" + p1.pattern() + "|" + p2.pattern() + ")");
Matcher outerMatcher = outer.matcher(page); Matcher outerMatcher = outer.matcher(page);
// In the defining areas, option names are represented as follows: // In the defining areas, option names are represented as follows:
// \f[CB]OPTION\f[R] or \f[CB]OPTION: // \f[V]OPTION\f[R] or \f[V]OPTION:
// where OPTION is the shortest string not containing whitespace or colon, // where OPTION is the shortest string not containing whitespace or colon,
// and in which all '-' characters are escaped with a single backslash. // and in which all '-' characters are escaped with a single backslash.
Pattern inner = Pattern.compile("\\s\\\\f\\[CB](\\\\-[^ :]+?)(:|\\\\f\\[R])"); Pattern inner = Pattern.compile("\\s\\\\f\\[V](-[^ :]+?)(:|\\\\f\\[R])");
while (outerMatcher.find()) { while (outerMatcher.find()) {
String lines = outerMatcher.group(); String lines = outerMatcher.group();
out.println("found:" + lines + "\n"); out.println("found:" + lines);
Matcher innerMatcher = inner.matcher(lines); Matcher innerMatcher = inner.matcher(lines);
while (innerMatcher.find()) { while (innerMatcher.find()) {
String option = innerMatcher.group(1).replace("\\-", "-"); String option = innerMatcher.group(1);
out.println(" found option:" + option);
list.add(option); list.add(option);
} }
out.println();
} }
return list; return list;