8225134: Update man-page files

Reviewed-by: erikj, mchung
This commit is contained in:
Jonathan Gibbons 2019-05-31 17:27:28 -07:00
parent 561c9182e8
commit d2ad9dabdf
30 changed files with 20241 additions and 14731 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,295 +19,392 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Remote Method Invocation (RMI) Tools
.\" Title: rmid.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH rmid 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
rmid \- Starts the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)\&.
.SH SYNOPSIS
.sp
.nf
\fBrmid\fR [\fIoptions\fR]
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.SH DESCRIPTION
The \f3rmid\fR command starts the activation system daemon\&. The activation system daemon must be started before activatable objects can be either registered with the activation system or activated in a JVM\&. For details on how to write programs that use activatable objects, the \fIUsing Activation\fR tutorial at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html
.TH "RMID" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
Start the daemon by executing the \f3rmid\fR command and specifying a security policy file, as follows:
.sp
.nf
\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fP
.fi
.nf
\f3\fP
.fi
.sp
When you run Oracle\(cqs implementation of the \f3rmid\fR command, by default you must specify a security policy file so that the \f3rmid\fR command can verify whether or not the information in each \f3ActivationGroupDesc\fR is allowed to be used to start a JVM for an activation group\&. Specifically, the command and options specified by the \f3CommandEnvironment\fR and any properties passed to an \f3ActivationGroupDesc\fR constructor must now be explicitly allowed in the security policy file for the \f3rmid\fR command\&. The value of the \f3sun\&.rmi\&.activation\&.execPolicy\fR property dictates the policy that the \f3rmid\fR command uses to determine whether or not the information in an \f3ActivationGroupDesc\fR can be used to start a JVM for an activation group\&. For more information see the description of the -J-Dsun\&.rmi\&.activation\&.execPolicy=policy option\&.
rmid \- start the activation system daemon that enables objects to be
registered and activated in a Java Virtual Machine (JVM)
.SH SYNOPSIS
.PP
Executing the \f3rmid\fR command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem\fR to the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR in this internal registry\&.
.PP
To specify an alternate port for the registry, you must specify the \f3-port\fR option when you execute the \f3rmid\fR command\&. For example, the following command starts the activation system daemon and a registry on the registry\&'s default port, 1099\&.
.sp
.nf
\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH START\ RMID\ ON\ DEMAND
An alternative to starting \f3rmid\fR from the command line is to configure \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) to start \f3rmid\fR on demand\&.
.PP
When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd\fR/\f3xinetd\fR) by calling the \f3System\&.inheritedChannel\fR method\&. If the inherited channel is null or not an instance of \f3java\&.nio\&.channels\&.ServerSocketChannel\fR, then RMID assumes that it was not started by \f3inetd\fR/\f3xinetd\fR, and it starts as previously described\&.
.PP
If the inherited channel is a \f3ServerSocketChannel\fR instance, then RMID uses the \f3java\&.net\&.ServerSocket\fR obtained from the \f3ServerSocketChannel\fR as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java\&.rmi\&.activation\&.ActivationSystem\fR is bound and the \f3java\&.rmi\&.activation\&.Activator\fR remote object\&. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
.TP 0.2i
\(bu
Output printed to \f3System\&.err\fR is redirected to a file\&. This file is located in the directory specified by the \f3java\&.io\&.tmpdir\fR system property (typically \f3/var/tmp\fR or \f3/tmp\fR) with the prefix \f3rmid-err\fR and the suffix \f3tmp\fR\&.
.TP 0.2i
\(bu
The \f3-port\fR option is not allowed\&. If this option is specified, then RMID exits with an error message\&.
.TP 0.2i
\(bu
The \f3-log\fR option is required\&. If this option is not specified, then RMID exits with an error message
.PP
See the man pages for \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) for details on how to configure services to be started on demand\&.
.SH OPTIONS
\f[CB]rmid\f[R] [\f[I]options\f[R]]
.TP
-C\fIoption\fR
.br
Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid\fR command when that process is created\&. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
.sp
.nf
\f3rmid \-C\-Dsome\&.property=value\fP
.fi
.nf
\f3\fP
.fi
.sp
This ability to pass command-line arguments to child processes can be useful for debugging\&. For example, the following command enables server-call logging in all child JVMs\&.
.sp
.nf
\f3rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
-J\fIoption\fR
.br
Specifies an option that is passed to the Java interpreter running RMID\&. For example, to specify that the \f3rmid\fR command use a policy file named \f3rmid\&.policy\fR, the \f3-J\fR option can be used to define the \f3java\&.security\&.policy\fR property on the \f3rmid\fR command line, for example:
.sp
.nf
\f3rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
-J-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR
.br
Specifies the policy that RMID employs to check commands and command-line options used to start the JVM in which an activation group runs\&. Please note that this option exists only in Oracle\&'s implementation of the Java RMI activation daemon\&. If this property is not specified on the command line, then the result is the same as though \f3-J-Dsun\&.rmi\&.activation\&.execPolicy=default\fR were specified\&. The possible values of \f3policy\fR can be \f3default\fR, \f3policyClassName\fR, or \f3none\fR\&.
.RS
.TP 0.2i
\(bu
default
The \f3default\fR or unspecified value \f3execPolicy\fR allows the \f3rmid\fR command to execute commands with specific command-line options only when the \f3rmid\fR command was granted permission to execute those commands and options in the security policy file that the \f3rmid\fR command uses\&. Only the default activation group implementation can be used with the default execution policy\&.
The \f3rmid\fR command starts a JVM for an activation group with the information in the group\&'s registered activation group descriptor, an \f3ActivationGroupDesc\fR\&. The group descriptor specifies an optional \f3ActivationGroupDesc\&.CommandEnvironment\fR that includes the command to execute to start the activation group and any command-line options to be added to the command line\&. By default, the \f3rmid\fR command uses the \f3java\fR command found in \f3java\&.home\fR\&. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>\fR\&.The \f3com\&.sun\&.rmi\&.rmid\&.ExecPermission\fR permission grants the \f3rmid\fR command permission to execute a command that is specified in the group descriptor\&'s \f3CommandEnvironment\fR to start an activation group\&. The \f3com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR permission enables the \f3rmid\fR command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment\fR when starting the activation group\&.When granting the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources\&.
\fIExecPermission\fR
The \f3ExecPermission\fR class represents permission for the \f3rmid\fR command to execute a specific command to start an activation group\&.
\fISyntax\fR: The name of an \f3ExecPermission\fR is the path name of a command to grant the \f3rmid\fR command permission to execute\&. A path name that ends in a slash (/) and an asterisk (*) indicates that all of the files contained in that directory where slash is the file-separator character, \f3File\&.separatorChar\fR\&. A path name that ends in a slash (/) and a minus sign (-) indicates all files and subdirectories contained in that directory (recursively)\&. A path name that consists of the special token \f3<<ALL FILES>>\fR matches any file\&.
A path name that consists of an asterisk (*) indicates all the files in the current directory\&. A path name that consists of a minus sign (-) indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory\&.
\fIExecOptionPermission\fR
The \f3ExecOptionPermission\fR class represents permission for the \f3rmid\fR command to use a specific command-line option when starting an activation group\&. The name of an \f3ExecOptionPermission\fR is the value of a command-line option\&.
\fISyntax\fR: Options support a limited wild card scheme\&. An asterisk signifies a wild card match, and it can appear as the option name itself (matches any option), or an asterisk (*) can appear at the end of the option name only when the asterisk (*) follows a dot (\&.) or an equals sign (=)\&.
For example: \f3*\fR or \f3-Dmydir\&.*\fR or \f3-Da\&.b\&.c=*\fR is valid, but \f3*mydir\fR or \f3-Da*b\fR or \f3ab*\fR is not\&.
\fIPolicy file for rmid\fR
When you grant the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources (universally)\&. It is safe to grant these permissions universally because only the \f3rmid\fR command checks these permissions\&.
An example policy file that grants various execute permissions to the \f3rmid\fR command is:
.sp
.nf
\f3grant {\fP
.fi
.nf
\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
.fi
.nf
\f3 "/files/apps/java/jdk1\&.7\&.0/solaris/bin/java";\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
.fi
.nf
\f3 "/files/apps/rmidcmds/*";\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
.fi
.nf
\f3 "\-Djava\&.security\&.policy=/files/policies/group\&.policy";\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
.fi
.nf
\f3 "\-Djava\&.security\&.debug=*";\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
.fi
.nf
\f3 "\-Dsun\&.rmi\&.*";\fP
.fi
.nf
\f3};\fP
.fi
.nf
\f3\fP
.fi
.sp
The first permission granted allows the \f3rmid\fR tcommand o execute the 1\&.7\&.0 release of the \f3java\fR command, specified by its explicit path name\&. By default, the version of the \f3java\fR command found in \f3java\&.home\fR is used (the same one that the \f3rmid\fR command uses), and does not need to be specified in the policy file\&. The second permission allows the \f3rmid\fR command to execute any command in the directory \f3/files/apps/rmidcmds\fR\&.
The third permission granted, an \f3ExecOptionPermission\fR, allows the \f3rmid\fR command to start an activation group that defines the security policy file to be \f3/files/policies/group\&.policy\fR\&. The next permission allows the \f3java\&.security\&.debug property\fR to be used by an activation group\&. The last permission allows any property in the \f3sun\&.rmi property\fR name hierarchy to be used by activation groups\&.
To start the \f3rmid\fR command with a policy file, the \f3java\&.security\&.policy\fR property needs to be specified on the \f3rmid\fR command line, for example:
\f3rmid -J-Djava\&.security\&.policy=rmid\&.policy\fR\&.
.TP 0.2i
\(bu
<policyClassName>
If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid\fR command, the name of a class whose \f3checkExecCommand\fR method is executed to check commands to be executed by the \f3rmid\fR command\&.
The \f3policyClassName\fR specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand\fR method:
.sp
.nf
\f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)\fP
.fi
.nf
\f3 throws SecurityException;\fP
.fi
.nf
\f3\fP
.fi
.sp
Before starting an activation group, the \f3rmid\fR command calls the policy\&'s \f3checkExecCommand\fR method and passes to it the activation group descriptor and an array that contains the complete command to start the activation group\&. If the \f3checkExecCommand\fR throws a \f3SecurityException\fR, then the \f3rmid\fR command does not start the activation group and an \f3ActivationException\fR is thrown to the caller attempting to activate the object\&.
.TP 0.2i
\(bu
none
If the \f3sun\&.rmi\&.activation\&.execPolicy\fR property value is \f3none\fR, then the \f3rmid\fR command does not perform any validation of commands to start activation groups\&.
.RE
.TP
-log \fIdir\fR
.br
Specifies the name of the directory the activation system daemon uses to write its database and associated information\&. The log directory defaults to creating a log, in the directory in which the \f3rmid\fR command was executed\&.
.TP
-port \fIport\fR
.br
Specifies the port the registry uses\&. The activation system daemon binds the \f3ActivationSystem\fR, with the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR, in this registry\&. The \f3ActivationSystem\fR on the local machine can be obtained using the following \f3Naming\&.lookup\fR method call:
.sp
.nf
\f3import java\&.rmi\&.*; \fP
.fi
.nf
\f3 import java\&.rmi\&.activation\&.*;\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 ActivationSystem system; system = (ActivationSystem)\fP
.fi
.nf
\f3 Naming\&.lookup("//:port/java\&.rmi\&.activation\&.ActivationSystem");\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
-stop
.br
Stops the current invocation of the \f3rmid\fR command for a port specified by the \f3-port\fR option\&. If no port is specified, then this option stops the \f3rmid\fR invocation running on port 1098\&.
.SH ENVIRONMENT\ VARIABLES
.TP
CLASSPATH
Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
java(1)
.TP 0.2i
\(bu
Setting the Class Path
.B \f[I]options\f[R]
This represent the command\-line options for the \f[CB]rmid\f[R] command.
See \f[B]Options for rmid\f[R].
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]rmid\f[R] command starts the activation system daemon.
The activation system daemon must be started before objects that can be
activated are either registered with the activation system or activated
in a JVM.
.PP
Start the daemon by executing the \f[CB]rmid\f[R] command and specifying a
security policy file, as follows:
.RS
.PP
\f[CB]rmid\ \-J\-Djava.security.policy=rmid.policy\f[R]
.RE
.PP
When you run Oracle\[aq]s implementation of the \f[CB]rmid\f[R] command,
by default you must specify a security policy file so that the
\f[CB]rmid\f[R] command can verify whether or not the information in each
\f[CB]ActivationGroupDesc\f[R] is allowed to be used to start a JVM for an
activation group.
Specifically, the command and options specified by the
\f[CB]CommandEnvironment\f[R] and any properties passed to an
\f[CB]ActivationGroupDesc\f[R] constructor must now be explicitly allowed
in the security policy file for the \f[CB]rmid\f[R] command.
The value of the \f[CB]sun.rmi.activation.execPolicy\f[R] property
dictates the policy that the \f[CB]rmid\f[R] command uses to determine
whether or not the information in an \f[CB]ActivationGroupDesc\f[R] can be
used to start a JVM for an activation group.
For more information see the description of the
\f[CB]\-J\-Dsun.rmi.activation.execPolicy=policy\f[R] option.
.PP
Executing the \f[CB]rmid\f[R] command starts the \f[CB]Activator\f[R] and an
internal registry on the default port 1098 and binds an
\f[CB]ActivationSystem\f[R] to the name
\f[CB]java.rmi.activation.ActivationSystem\f[R] in this internal registry.
.PP
To specify an alternate port for the registry, you must specify the
\f[CB]\-port\f[R] option when you execute the \f[CB]rmid\f[R] command.
For example, the following command starts the activation system daemon
and a registry on the registry\[aq]s default port, 1099.
.RS
.PP
\f[CB]rmid\ \-J\-Djava.security.policy=rmid.policy\ \-port\ 1099\f[R]
.RE
.SH START RMID ON DEMAND (ORACLE SOLARIS AND LINUX ONLY)
.PP
An alternative to starting \f[CB]rmid\f[R] from the command line is to
configure \f[CB]inetd\f[R] (Oracle Solaris) or \f[CB]xinetd\f[R] (Linux) to
start \f[CB]rmid\f[R] on demand.
.PP
When RMID starts, it attempts to obtain an inherited channel (inherited
from \f[CB]inetd\f[R]/\f[CB]xinetd\f[R]) by calling the
\f[CB]System.inheritedChannel\f[R] method.
If the inherited channel is null or not an instance of
\f[CB]java.nio.channels.ServerSocketChannel\f[R], then RMID assumes that
it wasn\[aq]t started by \f[CB]inetd\f[R]/\f[CB]xinetd\f[R], and it starts
as previously described.
.PP
If the inherited channel is a \f[CB]ServerSocketChannel\f[R] instance,
then RMID uses the \f[CB]java.net.ServerSocket\f[R] obtained from the
\f[CB]ServerSocketChannel\f[R] as the server socket that accepts requests
for the remote objects it exports: The registry in which the
\f[CB]java.rmi.activation.ActivationSystem\f[R] is bound and the
\f[CB]java.rmi.activation.Activator\f[R] remote object.
In this mode, RMID behaves the same as when it is started from the
command line, except in the following cases:
.IP \[bu] 2
Output printed to \f[CB]System.err\f[R] is redirected to a file.
This file is located in the directory specified by the
\f[CB]java.io.tmpdir\f[R] system property (typically \f[CB]/var/tmp\f[R] or
\f[CB]/tmp\f[R]) with the prefix \f[CB]rmid\-err\f[R] and the suffix
\f[CB]tmp\f[R].
.IP \[bu] 2
The \f[CB]\-port\f[R] option isn\[aq]t allowed.
If this option is specified, then RMID exits with an error message.
.IP \[bu] 2
The \f[CB]\-log\f[R] option is required.
If this option isn\[aq]t specified, then RMID exits with an error
message
.SH OPTIONS FOR RMID
.TP
.B \f[CB]\-C\f[R]\f[I]option\f[R]
Specifies an option that\[aq]s passed as a command\-line argument to
each child process (activation group) of the \f[CB]rmid\f[R] command when
that process is created.
For example, you could pass a property to each virtual machine spawned
by the activation system daemon:
.RS
.RS
.PP
\f[CB]rmid\ \-C\-Dsome.property=value\f[R]
.RE
.PP
This ability to pass command\-line arguments to child processes can be
useful for debugging.
For example, the following command enables server\-call logging in all
child JVMs.
.RS
.PP
\f[CB]rmid\ \-C\-Djava.rmi.server.logCalls=true\f[R]
.RE
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]option\f[R]
Specifies an option that\[aq]s passed to the Java interpreter running
RMID command.
For example, to specify that the \f[CB]rmid\f[R] command use a policy file
named \f[CB]rmid.policy\f[R], the \f[CB]\-J\f[R] option can be used to
define the \f[CB]java.security.policy\f[R] property on the \f[CB]rmid\f[R]
command line, for example:
.RS
.RS
.PP
\f[CB]rmid\ \-J\-Djava.security.policy\-rmid.policy\f[R]
.RE
.RE
.TP
.B \f[CB]\-J\-Dsun.rmi.activation.execPolicy=\f[R]\f[I]policy\f[R]
Specifies the policy that the RMID command employs to check commands and
command\-line options used to start the JVM in which an activation group
runs.
This option exists only in Oracle\[aq]s implementation of the Java RMI
activation daemon.
If this property isn\[aq]t specified on the command line, then the
result is the same as though
\f[CB]\-J\-Dsun.rmi.activation.execPolicy=default\f[R] were specified.
.RS
.PP
The possible values of \f[I]policy\f[R] can be \f[CB]default\f[R],
\f[I]policyClassName\f[R], or \f[CB]none\f[R].
.IP \[bu] 2
\f[CB]default\f[R]
.RS 2
.PP
The \f[CB]default\f[R] or unspecified value \f[CB]execPolicy\f[R] allows the
\f[CB]rmid\f[R] command to execute commands with specific command\-line
options only when the \f[CB]rmid\f[R] command was granted permission to
execute those commands and options in the security policy file that the
\f[CB]rmid\f[R] command uses.
Only the default activation group implementation can be used with the
default execution policy.
.PP
The \f[CB]rmid\f[R] command starts a JVM for an activation group with the
information in the group\[aq]s registered activation group descriptor,
\f[CB]ActivationGroupDesc\f[R].
The group descriptor specifies an optional
\f[CB]ActivationGroupDesc.CommandEnvironment\f[R] that includes the
command to execute to start the activation group and any command\-line
options to be added to the command line.
By default, the \f[CB]rmid\f[R] command uses the \f[CB]java\f[R] command
found in \f[CB]java.home\f[R].
The group descriptor also contains properties overrides that are added
to the command line as options defined as:
\f[CB]\-D\f[R]\f[I]property\f[R]\f[CB]=\f[R]\f[I]value\f[R].
The \f[CB]com.sun.rmi.rmid.ExecPermission\f[R] permission grants the
\f[CB]rmid\f[R] command permission to execute a command that\[aq]s
specified in the group descriptor\[aq]s \f[CB]CommandEnvironment\f[R] to
start an activation group.
The \f[CB]com.sun.rmi.rmid.ExecOptionPermission\f[R] permission enables
the \f[CB]rmid\f[R] command to use command\-line options, specified as
properties overrides in the group descriptor or as options in the
\f[CB]CommandEnvironment\f[R] when starting the activation group.
When granting the \f[CB]rmid\f[R] command permission to execute various
commands and options, the permissions \f[CB]ExecPermission\f[R] and
\f[CB]ExecOptionPermission\f[R] must be granted to all code sources.
.PP
\f[CB]ExecPermission\f[R] class: Represents permission for the
\f[CB]rmid\f[R] command to execute a specific command to start an
activation group.
.PP
\f[CB]ExecPermission\f[R] syntax: The name of \f[CB]ExecPermission\f[R] is
the path name of a command to grant the \f[CB]rmid\f[R] command permission
to execute.
.PP
A path name that ends in a slash (\f[CB]/\f[R]) and an asterisk
(\f[CB]*\f[R]) indicates that all of the files are contained in that
directory where the slash is the file\-separator character,
\f[CB]File.separatorChar\f[R].
.PP
A path name that ends in a slash (\f[CB]/\f[R]) and a minus sign
(\f[CB]\-\f[R]) indicates that all files and subdirectories are contained
in that directory (recursively).
.PP
A path name that consists of the special token \f[CB]<<ALL\ FILES>>\f[R]
matches any file.
.PP
A path name that consists of an asterisk (\f[CB]*\f[R]) indicates that all
the files are in the current directory.
.PP
A path name that consists of a minus sign (\f[CB]\-\f[R]) indicates that
all the files are in the current directory and (recursively) all files
and subdirectories are contained in the current directory.
.PP
\f[CB]ExecOptionPermission\f[R] class: Represents permission for the
\f[CB]rmid\f[R] command to use a specific command\-line option when
starting an activation group.
The name of \f[CB]ExecOptionPermission\f[R] is the value of a
command\-line option.
.PP
\f[CB]ExecOptionPermission\f[R] syntax: Options support a limited wild
card scheme.
An asterisk signifies a wild card match, and it can appear as the option
name itself (matches any option), or an asterisk (*) can appear at the
end of the option name only when the asterisk (\f[CB]*\f[R]) follows a dot
(\f[CB]\&.\f[R]) or an equals sign (\f[CB]=\f[R]).
.PP
For example: \f[CB]*\f[R] or \f[CB]\-Dmydir.*\f[R] or \f[CB]\-Da.b.c=*\f[R] is
valid, but \f[CB]*mydir\f[R] or \f[CB]\-Da*b\f[R] or \f[CB]ab*\f[R] isn\[aq]t
valid.
.PP
\f[B]Policy file for rmid\f[R]
.PP
When you grant the \f[CB]rmid\f[R] command permission to execute various
commands and options, the permissions \f[CB]ExecPermission\f[R] and
\f[CB]ExecOptionPermission\f[R] must be granted to all code sources
(universally).
It is safe to grant these permissions universally because only the
\f[CB]rmid\f[R] command checks these permissions.
.PP
An example policy file that grants various execute permissions to the
\f[CB]rmid\f[R] command is:
.IP \[bu] 2
\f[B]Oracle Solaris:\f[R]
.RS 2
.IP
.nf
\f[CB]
grant\ {
\ \ \ \ permission\ com.sun.rmi.rmid.ExecPermission
\ \ \ \ \ \ \ \ "/files/apps/java/jdk1.7.0/solaris/bin/java";
\ \ \ \ permission\ com.sun.rmi.rmid.ExecPermission
\ \ \ \ \ \ \ \ "/files/apps/rmidcmds/*";
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
\ \ \ \ \ \ \ \ "\-Djava.security.policy=/files/policies/group.policy";
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
\ \ \ \ \ \ \ \ "\-Djava.security.debug=*";
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
\ \ \ \ \ \ \ \ "\-Dsun.rmi.*";
};
\f[R]
.fi
.RE
.IP \[bu] 2
\f[B]Windows:\f[R]
.RS 2
.IP
.nf
\f[CB]
grant\ {
\ \ \ \ permission\ com.sun.rmi.rmid.ExecPermission
\ \ \ \ \ \ \ \ "c:\\\\files\\\\apps\\\\java\\\\jdk1.7.0\\\\win\\\\bin\\\\java";
\ \ \ \ permission\ com.sun.rmi.rmid.ExecPermission
\ \ \ \ \ \ \ \ "c:\\\\files\\\\apps\\\\rmidcmds\\\\*";
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
\ \ \ \ \ \ \ \ "\-Djava.security.policy=c:\\\\files\\\\policies\\\\group.policy";
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
\ \ \ \ \ \ \ \ "\-Djava.security.debug=*";
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
\ \ \ \ \ \ \ \ "\-Dsun.rmi.*";
};
\f[R]
.fi
.RE
.PP
The first permission granted allows the \f[CB]rmid\f[R] command to execute
the 1.7.0 release of the \f[CB]java\f[R] command, specified by its
explicit path name.
By default, the version of the \f[CB]java\f[R] command found in
\f[CB]java.home\f[R] is used (the same one that the \f[CB]rmid\f[R] command
uses), and doesn\[aq]t need to be specified in the policy file.
The second permission allows the \f[CB]rmid\f[R] command to execute any
command in either the directory \f[CB]/files/apps/rmidcmds\f[R] (Oracle
Solaris, Linux, and macOS) or the directory
\f[CB]c:\\files\\apps\\rmidcmds\\\f[R] (Windows).
.PP
The third permission granted, \f[CB]ExecOptionPermission\f[R], allows the
\f[CB]rmid\f[R] command to start an activation group that defines the
security policy file to be either \f[CB]/files/policies/group.policy\f[R]
(Oracle Solaris) or \f[CB]c:\\files\\policies\\group.policy\f[R]
(Windows).
The next permission allows the \f[CB]java.security.debug\ property\f[R] to
be used by an activation group.
The last permission allows any property in the
\f[CB]sun.rmi\ property\f[R] name hierarchy to be used by activation
groups.
.PP
To start the \f[CB]rmid\f[R] command with a policy file, the
\f[CB]java.security.policy\f[R] property needs to be specified on the
\f[CB]rmid\f[R] command line, for example:
.PP
\f[CB]rmid\ \-J\-Djava.security.policy=rmid.policy\f[R].
.RE
.IP \[bu] 2
\f[I]policyClassName\f[R]
.RS 2
.PP
If the default behavior isn\[aq]t flexible enough, then an administrator
can provide, when starting the \f[CB]rmid\f[R] command, the name of a
class whose \f[CB]checkExecCommand\f[R] method is executed to check
commands to be executed by the \f[CB]rmid\f[R] command.
.PP
The \f[CB]policyClassName\f[R] specifies a public class with a public,
no\-argument constructor and an implementation of the following
\f[CB]checkExecCommand\f[R] method:
.IP
.nf
\f[CB]
\ public\ void\ checkExecCommand(ActivationGroupDesc\ desc,\ String[]\ command)
\ \ \ \ \ \ \ \ throws\ SecurityException;
\f[R]
.fi
.PP
Before starting an activation group, the \f[CB]rmid\f[R] command calls the
policy\[aq]s \f[CB]checkExecCommand\f[R] method and passes to it the
activation group descriptor and an array that contains the complete
command to start the activation group.
If the \f[CB]checkExecCommand\f[R] throws a \f[CB]SecurityException\f[R],
then the \f[CB]rmid\f[R] command doesn\[aq]t start the activation group
and an \f[CB]ActivationException\f[R] is thrown to the caller attempting
to activate the object.
.RE
.IP \[bu] 2
\f[CB]none\f[R]
.RS 2
.PP
If the \f[CB]sun.rmi.activation.execPolicy\f[R] property value is
\f[CB]none\f[R], then the \f[CB]rmid\f[R] command doesn\[aq]t perform any
validation of commands to start activation groups.
.RE
.RE
.TP
.B \f[CB]\-log\f[R] \f[I]dir\f[R]
Specifies the name of the directory that the activation system daemon
uses to write its database and associated information.
The log directory defaults to creating a log, in the directory in which
the \f[CB]rmid\f[R] command was executed.
.RS
.RE
.TP
.B \f[CB]\-port\f[R] \f[I]port\f[R]
Specifies the port that the registry uses.
The activation system daemon binds \f[CB]ActivationSystem\f[R], with the
name \f[CB]java.rmi.activation.ActivationSystem\f[R], in this registry.
The \f[CB]ActivationSystem\f[R] on the local machine can be obtained using
the following \f[CB]Naming.lookup\f[R] method call:
.RS
.IP
.nf
\f[CB]
import\ java.rmi.*;
import\ java.rmi.activation.*;
ActivationSystem\ system;\ system\ =\ (ActivationSystem)
Naming.lookup("//:port/java.rmi.activation.ActivationSystem");
\f[R]
.fi
.RE
.TP
.B \f[CB]\-stop\f[R]
Stops the current invocation of the \f[CB]rmid\f[R] command for a port
specified by the \f[CB]\-port\f[R] option.
If no port is specified, then this option stops the \f[CB]rmid\f[R]
invocation running on port 1098.
.RS
.RE
.br
'pl 8.5i
'bp

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,79 +19,74 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Remote Method Invocation (RMI) Tools
.\" Title: rmiregistry.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH rmiregistry 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
rmiregistry \- Starts a remote object registry on the specified port on the current host\&.
.SH SYNOPSIS
.sp
.nf
\fBrmiregistry\fR [ \fIport\fR ]
.fi
.sp
.TP
\fIport\fR
The number of a \f3port\fR on the current host at which to start the remote object registry\&.
.SH DESCRIPTION
The \f3rmiregistry\fR command creates and starts a remote object registry on the specified port on the current host\&. If the port is omitted, then the registry is started on port 1099\&. The \f3rmiregistry\fR command produces no output and is typically run in the background, for example:
.sp
.nf
\f3rmiregistry &\fP
.fi
.nf
\f3\fP
.fi
.sp
A remote object registry is a bootstrap naming service that is used by RMI servers on the same host to bind remote objects to names\&. Clients on local and remote hosts can then look up remote objects and make remote method invocations\&.
.TH "RMIREGISTRY" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
The registry is typically used to locate the first remote object on which an application needs to call methods\&. That object then provides application-specific support for finding other objects\&.
rmiregistry \- create and start a remote object registry on the
specified port on the current host
.SH SYNOPSIS
.PP
The methods of the \f3java\&.rmi\&.registry\&.LocateRegistry\fR class are used to get a registry operating on the local host or local host and port\&.
.PP
The URL-based methods of the \f3java\&.rmi\&.Naming\fR class operate on a registry and can be used to look up a remote object on any host and on the local host\&. Bind a simple name (string) to a remote object, rebind a new name to a remote object (overriding the old binding), unbind a remote object, and list the URL bound in the registry\&.
.SH OPTIONS
\f[CB]rmiregistry\f[R] [\f[I]options\f[R]] [\f[I]port\f[R]]
.TP
-J
.br
Used with any Java option to pass the option following the \f3-J\fR (no spaces between the \f3-J\fR and the option) to the Java interpreter\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
java(1)
.TP 0.2i
\(bu
\f3java\&.rmi\&.registry\&.LocateRegistry\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html
.TP 0.2i
\(bu
\f3java\&.rmi\&.Naming class description\fR at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html
.B \f[I]options\f[R]
This represents the option for the \f[CB]rmiregistry\f[R] command.
See \f[B]Options\f[R]
.RS
.RE
.TP
.B \f[I]port\f[R]
The number of a port on the current host at which to start the remote
object registry.
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]rmiregistry\f[R] command creates and starts a remote object
registry on the specified port on the current host.
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
in the background, for example:
.RS
.PP
\f[CB]rmiregistry\ &\f[R]
.RE
.PP
A remote object registry is a bootstrap naming service that\[aq]s used
by RMI servers on the same host to bind remote objects to names.
Clients on local and remote hosts can then look up remote objects and
make remote method invocations.
.PP
The registry is typically used to locate the first remote object on
which an application needs to call methods.
That object then provides application\-specific support for finding
other objects.
.PP
The methods of the \f[CB]java.rmi.registry.LocateRegistry\f[R] class are
used to get a registry operating on the local host or local host and
port.
.PP
The URL\-based methods of the \f[CB]java.rmi.Naming\f[R] class operate on
a registry and can be used to:
.IP \[bu] 2
Bind the specified name to a remote object
.IP \[bu] 2
Return an array of the names bound in the registry
.IP \[bu] 2
Return a reference, a stub, for the remote object associated with the
specified name
.IP \[bu] 2
Rebind the specified name to a new remote object
.IP \[bu] 2
Destroy the binding for the specified name that\[aq]s associated with a
remote object
.SH OPTIONS
.TP
.B \f[CB]\-J\f[R]\f[I]option\f[R]
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
Java interpreter.
.RS
.RE
.br
'pl 8.5i
'bp

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,176 +19,157 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Scripting Tools
.\" Title: jrunscript.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jrunscript 1 "21 November 2013" "JDK 8" "Scripting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jrunscript \- Runs a command-line script shell that supports interactive and batch modes\&. This command is experimental and unsupported\&.
.SH SYNOPSIS
.sp
.nf
\fBjrunscript\fR [\fIoptions\fR] [\fIarguments\fR]
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fIarguments\fR
Arguments, when used, follow immediately after options or the command name\&. See Arguments\&.
.SH DESCRIPTION
The \f3jrunscript\fR command is a language-independent command-line script shell\&. The \f3jrunscript\fR command supports both an interactive (read-eval-print) mode and a batch (\f3-f\fR option) mode of script execution\&. By default, JavaScript is the language used, but the \f3-l\fR option can be used to specify a different language\&. By using Java to scripting language communication, the \f3jrunscript\fR command supports an exploratory programming style\&.
.SH OPTIONS
.TH "JRUNSCRIPT" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
jrunscript \- run a command\-line script shell that supports interactive
and batch modes
.SH SYNOPSIS
.PP
\f[B]Note:\f[R]
.PP
This tool is \f[B]experimental\f[R]\ and unsupported.
.PP
\f[CB]jrunscript\f[R] [\f[I]options\f[R]] [\f[I]arguments\f[R]]
.TP
-classpath \fIpath\fR
.br
Indicate where any class files are that the script needs to access\&.
.TP
-cp \fIpath\fR
.br
Same as \f3-classpath\fR\f3path\fR\&.
.TP
-D\fIname\fR=\fIvalue\fR
.br
Sets a Java system property\&.
.TP
-J\fIflag\fR
.br
Passes \f3flag\fR directly to the Java Virtual Machine where the \f3jrunscript\fR command is running\&.
.TP
-I \fIlanguage\fR
.br
Uses the specified scripting language\&. By default, JavaScript is used\&. To use other scripting languages, you must specify the corresponding script engine\&'s JAR file with the \f3-cp\fR or \f3-classpath\fR option\&.
.TP
-e \fIscript\fR
.br
Evaluates the specified script\&. This option can be used to run one-line scripts that are specified completely on the command line\&.
.TP
-encoding \fIencoding\fR
.br
Specifies the character encoding used to read script files\&.
.TP
-f \fIscript-file\fR
.br
Evaluates the specified script file (batch mode)\&.
.TP
-f -
.br
Reads and evaluates a script from standard input (interactive mode)\&.
.TP
-help
.br
Displays a help message and exits\&.
.TP
-?
.br
Displays a help message and exits\&.
.TP
-q
.br
Lists all script engines available and exits\&.
.SH ARGUMENTS
If arguments are present and if no \f3-e\fR or \f3-f\fR option is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script\&. If arguments and \f3-e\fR or the \f3-f\fR option are used, then all arguments are passed to the script\&. If arguments, \f3-e\fR and \f3-f\fR are missing, then interactive mode is used\&. Script arguments are available to a script in an engine variable named \f3arguments\fR of type \f3String\fR array\&.
.SH EXAMPLES
.SS EXECUTE\ INLINE\ SCRIPTS
.sp
.nf
\f3jrunscript \-e "print(\&'hello world\&')"\fP
.fi
.nf
\f3jrunscript \-e "cat(\&'http://www\&.example\&.com\&')"\fP
.fi
.nf
\f3\fP
.fi
.sp
.SS USE\ SPECIFIED\ LANGUAGE\ AND\ EVALUATE\ THE\ SCRIPT\ FILE
.sp
.nf
\f3jrunscript \-l js \-f test\&.js\fP
.fi
.nf
\f3\fP
.fi
.sp
.SS INTERACTIVE\ MODE
.sp
.nf
\f3jrunscript\fP
.fi
.nf
\f3js> print(\&'Hello World\en\&');\fP
.fi
.nf
\f3Hello World\fP
.fi
.nf
\f3js> 34 + 55\fP
.fi
.nf
\f389\&.0\fP
.fi
.nf
\f3js> t = new java\&.lang\&.Thread(function() { print(\&'Hello World\en\&'); })\fP
.fi
.nf
\f3Thread[Thread\-0,5,main]\fP
.fi
.nf
\f3js> t\&.start()\fP
.fi
.nf
\f3js> Hello World\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3js>\fP
.fi
.nf
\f3\fP
.fi
.sp
.SS RUN\ SCRIPT\ FILE\ WITH\ SCRIPT\ ARGUMENTS
The test\&.js file is the script file\&. The \f3arg1\fR, \f3arg2\fR and \f3arg3\fR arguments are passed to the script\&. The script can access these arguments with an arguments array\&.
.sp
.nf
\f3jrunscript test\&.js arg1 arg2 arg3\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH SEE\ ALSO
If JavaScript is used, then before it evaluates a user defined script, the \f3jrunscript\fR command initializes certain built-in functions and objects\&. These JavaScript built-ins are documented in JsDoc-Toolkit at http://code\&.google\&.com/p/jsdoc-toolkit/
.B \f[I]options\f[R]
This represents the \f[CB]jrunscript\f[R] command\-line options that can
be used.
See \f[B]Options for the jrunscript Command\f[R].
.RS
.RE
.TP
.B \f[I]arguments\f[R]
Arguments, when used, follow immediately after options or the command
name.
See \f[B]Arguments\f[R].
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]jrunscript\f[R] command is a language\-independent command\-line
script shell.
The \f[CB]jrunscript\f[R] command supports both an interactive
(read\-eval\-print) mode and a batch (\f[CB]\-f\f[R] option) mode of
script execution.
By default, JavaScript is the language used, but the \f[CB]\-l\f[R] option
can be used to specify a different language.
By using Java to scripting language communication, the
\f[CB]jrunscript\f[R] command supports an exploratory programming style.
.PP
If JavaScript is used, then before it evaluates a user defined script,
the \f[CB]jrunscript\f[R] command initializes certain built\-in functions
and objects, which are documented in the API Specification for
\f[CB]jrunscript\f[R] JavaScript built\-in functions.
.SH OPTIONS FOR THE JRUNSCRIPT COMMAND
.TP
.B \f[CB]\-cp\f[R] \f[I]path\f[R] or \f[CB]\-classpath\f[R] \f[I]path\f[R]
Indicates where any class files are that the script needs to access.
.RS
.RE
.TP
.B \f[CB]\-D\f[R]\f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R]
Sets a Java system property.
.RS
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]flag\f[R]
Passes \f[I]flag\f[R] directly to the Java Virtual Machine where the
\f[CB]jrunscript\f[R] command is running.
.RS
.RE
.TP
.B \f[CB]\-l\f[R] \f[I]language\f[R]
Uses the specified scripting language.
By default, JavaScript is used.
To use other scripting languages, you must specify the corresponding
script engine\[aq]s JAR file with the \f[CB]\-cp\f[R] or
\f[CB]\-classpath\f[R] option.
.RS
.RE
.TP
.B \f[CB]\-e\f[R] \f[I]script\f[R]
Evaluates the specified script.
This option can be used to run one\-line scripts that are specified
completely on the command line.
.RS
.RE
.TP
.B \f[CB]\-encoding\f[R] \f[I]encoding\f[R]
Specifies the character encoding used to read script files.
.RS
.RE
.TP
.B \f[CB]\-f\f[R] \f[I]script\-file\f[R]
Evaluates the specified script file (batch mode).
.RS
.RE
.TP
.B \f[CB]\-f\ \-\f[R]
Enters interactive mode to read and evaluate a script from standard
input.
.RS
.RE
.TP
.B \f[CB]\-help\f[R] or \f[CB]\-?\f[R]
Displays a help message and exits.
.RS
.RE
.TP
.B \f[CB]\-q\f[R]
Lists all script engines available and exits.
.RS
.RE
.SH ARGUMENTS
.PP
If arguments are present and if no \f[CB]\-e\f[R] or \f[CB]\-f\f[R] option
is used, then the first argument is the script file and the rest of the
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,
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
interactive mode is used.
.SH EXAMPLE OF EXECUTING INLINE SCRIPTS
.RS
.PP
\f[CB]jrunscript\ \-e\ "print(\[aq]hello\ world\[aq])"\f[R]
.RE
.RS
.PP
\f[CB]jrunscript\ \-e\ "cat(\[aq]http://www.example.com\[aq])"\f[R]
.RE
.SH EXAMPLE OF USING SPECIFIED LANGUAGE AND EVALUATE THE SCRIPT FILE
.RS
.PP
\f[CB]jrunscript\ \-l\ js\ \-f\ test.js\f[R]
.RE
.SH EXAMPLE OF INTERACTIVE MODE
.IP
.nf
\f[CB]
jrunscript
js>\ print(\[aq]Hello\ World\\n\[aq]);
Hello\ World
js>\ 34\ +\ 55
89.0
js>\ t\ =\ new\ java.lang.Thread(function()\ {\ print(\[aq]Hello\ World\\n\[aq]);\ })
Thread[Thread\-0,5,main]
js>\ t.start()
js>\ Hello\ World
js>
\f[R]
.fi
.SH RUN SCRIPT FILE WITH SCRIPT ARGUMENTS
.PP
In this example, the \f[CB]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
to the script.
The script can access these arguments with an arguments array.
.RS
.PP
\f[CB]jrunscript\ test.js\ arg1\ arg2\ arg3\f[R]
.RE
.br
'pl 8.5i
'bp

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,88 +19,66 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Remote Method Invocation (RMI) Tools
.\" Title: serialver.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH serialver 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
serialver \- Returns the serial version UID for specified classes\&.
.SH SYNOPSIS
.sp
.nf
\fBserialver\fR [ \fIoptions\fR ] [ \fIclassnames\fR ]
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fIclassnames\fR
The classes for which the \f3serialVersionUID\fR is to be returned\&.
.SH DESCRIPTION
The \f3serialver\fR command returns the \f3serialVersionUID\fR for one or more classes in a form suitable for copying into an evolving class\&. When called with no arguments, the \f3serialver\fR command prints a usage line\&.
.SH OPTIONS
.TH "SERIALVER" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
serialver \- return the \f[CB]serialVersionUID\f[R] for one or more
classes in a form suitable for copying into an evolving class
.SH SYNOPSIS
.PP
\f[CB]serialver\f[R] [\f[I]options\f[R]] [\f[I]classnames\f[R]]
.TP
-classpath \fIpath-files\fR
.br
Sets the search path for application classes and resources\&. Separate classes and resources with a colon (:)\&.
.TP
-show
.br
Displays a simple user interface\&. Enter the full class name and press either the \fIEnter\fR key or the \fIShow\fR button to display the \f3serialVersionUID\fR\&.
.TP
-J\fIoption\fR
.br
Passes \f3option\fR to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.SH NOTES
The \f3serialver\fR command loads and initializes the specified classes in its virtual machine, and by default, it does not set a security manager\&. If the \f3serialver\fR command is to be run with untrusted classes, then a security manager can be set with the following option:
.sp
.nf
\f3\-J\-Djava\&.security\&.manager\fP
.fi
.nf
\f3\fP
.fi
.sp
When necessary, a security policy can be specified with the following option:
.sp
.nf
\f3\-J\-Djava\&.security\&.policy=<policy file>\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH SEE\ ALSO
.TP 0.2i
\(bu
The \f3java\&.io\&.ObjectStream\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.html
.B \f[I]options\f[R]
This represents the command\-line options for the \f[CB]serialver\f[R]
command.
See \f[B]Options for serialver\f[R].
.RS
.RE
.TP
.B \f[I]classnames\f[R]
The classes for which \f[CB]serialVersionUID\f[R] is to be returned.
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]serialver\f[R] command returns the \f[CB]serialVersionUID\f[R] for
one or more classes in a form suitable for copying into an evolving
class.
When called with no arguments, the \f[CB]serialver\f[R] command prints a
usage line.
.SH OPTIONS FOR SERIALVER
.TP
.B \f[CB]\-classpath\f[R] \f[I]path\-files\f[R]
Sets the search path for application classes and resources.
Separate classes and resources with a colon (:).
.RS
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]option\f[R]
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
for the Java application launcher.
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB.
.RS
.RE
.SH NOTES
.PP
The \f[CB]serialver\f[R] command loads and initializes the specified
classes in its virtual machine, and by default, it doesn\[aq]t set a
security manager.
If the \f[CB]serialver\f[R] command is to be run with untrusted classes,
then a security manager can be set with the following option:
.RS
.PP
\f[CB]\-J\-Djava.security.manager\f[R]
.RE
.PP
When necessary, a security policy can be specified with the following
option:
.RS
.PP
\f[CB]\-J\-Djava.security.policy=\f[R]\f[I]policy_file\f[R]
.RE
.br
'pl 8.5i
'bp

View File

@ -0,0 +1,274 @@
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation.
.\"
.\" This code is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code).
.\"
.\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Automatically generated by Pandoc 2.3.1
.\"
.TH "JHSDB" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
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
(JVM)
.SH SYNOPSIS
.PP
\f[CB]jhsdb\f[R] \f[CB]clhsdb\f[R] [\f[CB]\-\-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]]
.PP
\f[CB]jhsdb\f[R] \f[CB]debugd\f[R] [\f[I]options\f[R]] (\f[I]pid\f[R] |
\f[I]executable\f[R] \f[I]coredump\f[R]) [\f[I]server\-id\f[R]]
.PP
\f[CB]jhsdb\f[R] \f[CB]hsdb\f[R] [\f[CB]\-\-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]]
.PP
\f[CB]jhsdb\f[R] \f[CB]jstack\f[R] [\f[CB]\-\-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[I]options\f[R]]
.PP
\f[CB]jhsdb\f[R] \f[CB]jmap\f[R] [\f[CB]\-\-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[I]options\f[R]]
.PP
\f[CB]jhsdb\f[R] \f[CB]jinfo\f[R] [\f[CB]\-\-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[I]options\f[R]]
.PP
\f[CB]jhsdb\f[R] \f[CB]jsnap\f[R] [\f[I]options\f[R]] [\f[CB]\-\-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]]
.TP
.B \f[I]pid\f[R]
The process ID to which the \f[CB]jhsdb\f[R] tool should attach.
The process must be a Java process.
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
separate docker instance, the \f[B]jps\f[R] command.
.RS
.PP
\f[B]Note:\f[R] JDK 10 has added support for using the Attach API when
attaching to Java processes running in a separate docker process.
However, the \f[CB]jps\f[R] command will not list the JVM processes that
are running in a separate docker instance.
If you are trying to connect a Linux host with a Virtual Machine that is
in a docker container, you must use tools such as \f[CB]ps\f[R] to look up
the PID of the JVM.
.RE
.TP
.B \f[I]server\-id\f[R]
An optional unique ID to use when multiple debug servers are running on
the same remote host.
.RS
.RE
.TP
.B \f[I]executable\f[R]
The Java executable file from which the core dump was produced.
.RS
.RE
.TP
.B \f[I]coredump\f[R]
The core file to which the \f[CB]jhsdb\f[R] tool should attach.
.RS
.RE
.TP
.B \f[I]options\f[R]
The command\-line options for a \f[CB]jhsdb\f[R] mode.
See \f[B]Common Options for jhsdb Modes\f[R], \f[B]Options for the debugd
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 jmap Mode\f[R], \f[B]Options for the
jstack Mode\f[R], and \f[B]Options for the jsnap Mode\f[R].
.RS
.RE
.PP
\f[B]Note:\f[R]
.PP
Either the \f[I]pid\f[R] or the pair of \f[I]executable\f[R] and
\f[I]core\f[R] files must be provided.
.SH DESCRIPTION
.PP
You can use the \f[CB]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
a crashed Java Virtual Machine (JVM).
This command is experimental and unsupported.
.PP
\f[B]Note:\f[R]
.PP
Attaching the \f[CB]jhsdb\f[R] tool to a live process will cause the
process to hang and the process will probably crash when the debugger
detaches.
.PP
The \f[CB]jhsdb\f[R] tool can be launched in any one of the following
modes:
.TP
.B \f[CB]jhsdb\ clhsdb\f[R]
Starts the interactive command\-line debugger.
.RS
.RE
.TP
.B \f[CB]jhsdb\ debugd\f[R]
Starts the remote debug server.
.RS
.RE
.TP
.B \f[CB]jhsdb\ hsdb\f[R]
Starts the interactive GUI debugger.
.RS
.RE
.TP
.B \f[CB]jhsdb\ jstack\f[R]
Prints stack and locks information.
.RS
.RE
.TP
.B \f[CB]jhsdb\ jmap\f[R]
Prints heap information.
.RS
.RE
.TP
.B \f[CB]jhsdb\ jinfo\f[R]
Prints basic JVM information.
.RS
.RE
.TP
.B \f[CB]jhsdb\ jsnap\f[R]
Prints performance counter information.
.RS
.RE
.SH COMMON OPTIONS FOR JHSDB MODES
.PP
In addition to any required \f[CB]jstack\f[R], \f[CB]jmap\f[R],
\f[CB]jinfo\f[R] or \f[CB]jsnap\f[R] mode specific options, the
\f[CB]pid\f[R], \f[CB]exe\f[R], or \f[CB]core\f[R] options must be provided
for all modes.
The following options are available for all modes.
.TP
.B \f[CB]\-\-pid\f[R]
The process ID of the hanging process.
.RS
.RE
.TP
.B \f[CB]\-\-exe\f[R]
The executable file name.
.RS
.RE
.TP
.B \f[CB]\-\-core\f[R]
The core dump file name.
.RS
.RE
.TP
.B \f[CB]\-\-help\f[R]
Displays the options available for the command.
.RS
.RE
.SH OPTIONS FOR THE DEBUGD MODE
.TP
.B \f[I]server\-id\f[R]
An optional unique ID for this debug server.
This is required if multiple debug servers are run on the same machine.
.RS
.RE
.SH OPTIONS FOR THE JINFO MODE
.PP
Without specified options, the \f[CB]jhsdb\ jinfo\f[R] prints both flags
and properties.
.TP
.B \f[CB]\-\-flags\f[R]
Prints the VM flags.
.RS
.RE
.TP
.B \f[CB]\-\-sysprops\f[R]
Prints the Java system properties.
.RS
.RE
.TP
.B no option
Prints the VM flags and the Java system properties.
.RS
.RE
.SH OPTIONS FOR THE JMAP MODE
.PP
In addition to the following mode specific options, the \f[CB]pid\f[R],
\f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options
for jhsdb Modes\f[R] must be provided.
.TP
.B no option
Prints the same information as Solaris \f[CB]pmap\f[R].
.RS
.RE
.TP
.B \f[CB]\-\-heap\f[R]
Prints the \f[CB]java\f[R] heap summary.
.RS
.RE
.TP
.B \f[CB]\-\-binaryheap\f[R]
Dumps the \f[CB]java\f[R] heap in \f[CB]hprof\f[R] binary format.
.RS
.RE
.TP
.B \f[CB]\-\-dumpfile\f[R]
Prints the name of the dumpfile.
.RS
.RE
.TP
.B \f[CB]\-\-histo\f[R]
Prints the histogram of \f[CB]java\f[R] object heap.
.RS
.RE
.TP
.B \f[CB]\-\-clstats\f[R]
Prints the class loader statistics.
.RS
.RE
.TP
.B \f[CB]\-\-finalizerinfo\f[R]
Prints the information on objects awaiting finalization.
.RS
.RE
.SH OPTIONS FOR THE JSTACK MODE
.PP
In addition to the following mode specific options, the \f[CB]pid\f[R],
\f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options
for jhsdb Modes\f[R] must be provided.
.TP
.B \f[CB]\-\-locks\f[R]
Prints the \f[CB]java.util.concurrent\f[R] locks information.
.RS
.RE
.TP
.B \f[CB]\-\-mixed\f[R]
Attempts to print both \f[CB]java\f[R] and native frames if the platform
allows it.
.RS
.RE
.SH OPTIONS FOR THE JSNAP MODE
.PP
In addition to the following mode specific option, the \f[CB]pid\f[R],
\f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options
for jhsdb Modes\f[R] must be provided.
.TP
.B \f[CB]\-\-all\f[R]
Prints all performance counters.
.RS
.RE

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,465 +19,328 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Basic Tools
.\" Title: jar.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jar 1 "21 November 2013" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jar \- Manipulates Java Archive (JAR) files\&.
.SH SYNOPSIS
Create JAR file
.sp
.nf
\fBjar c\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
.fi
.sp
Update JAR file
.sp
.nf
\fBjar u\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
.fi
.sp
Extract JAR file
.sp
.nf
\fBjar\fR \fBx\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
.fi
.sp
List Contents of JAR file
.sp
.nf
\fBjar\fR \fBt\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
.fi
.sp
Add Index to JAR file
.sp
.nf
\fBjar\fR \fBi\fR \fIjarfile\fR [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
.fi
.sp
.SH DESCRIPTION
The \f3jar\fR command is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format\&. However, the \f3jar\fR command was designed mainly to package Java applets or applications into a single archive\&. When the components of an applet or application (files, images and 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 requiring a new connection for each piece\&. This dramatically improves download times\&. The \f3jar\fR command also compresses files, which further improves download time\&. The \f3jar\fR command also allows individual entries in a file to be signed by the applet author so that their origin can be authenticated\&. A JAR file can be used as a class path entry, whether or not it is compressed\&.
.TH "JAR" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
The syntax for the \f3jar\fR command resembles the syntax for the \f3tar\fR command\&. It has several operation modes, defined by one of the mandatory \fIoperation arguments\fR\&. Other arguments are either \fIoptions\fR that modify the behavior of the operation, or \fIoperands\fR required to perform the operation\&.
.SH OPERATION\ ARGUMENTS
When using the \f3jar\fR command, you have to select an operation to be performed by specifying one of the following operation arguments\&. You can mix them up with other one-letter options on the command line, but usually the operation argument is the first argument specified\&.
.TP
c
Create a new JAR archive\&.
.TP
i
Generate index information for a JAR archive\&.
.TP
t
List the contents of a JAR archive\&.
.TP
u
Update a JAR archive\&.
.TP
x
Extract files from a JAR archive\&.
.SH OPTIONS
Use the following options to customize how the JAR file is created, updated, extracted, or viewed:
.TP
e
Sets the class specified by the \fIentrypoint\fR operand to be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The use of this option creates or overrides the \f3Main-Class\fR attribute value in the manifest file\&. The \f3e\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
For example, the following command creates the \f3Main\&.jar\fR archive with the \f3Main\&.class\fR file where the \f3Main-Clas\fRs attribute value in the manifest is set to \f3Main\fR:
.sp
.nf
\f3jar cfe Main\&.jar Main Main\&.class\fP
.fi
.nf
\f3\fP
.fi
.sp
The Java Runtime Environment (JRE) can directly call this application by running the following command:
.sp
.nf
\f3java \-jar Main\&.jar\fP
.fi
.nf
\f3\fP
.fi
.sp
If the entry point class name is in a package, then it could use either the dot (\&.) or slash (/) as the delimiter\&. For example, if \f3Main\&.class\fR is in a package called \f3mydir\fR, then the entry point can be specified in one of the following ways:
.sp
.nf
\f3jar \-cfe Main\&.jar mydir/Main mydir/Main\&.class\fP
.fi
.nf
\f3jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class\fP
.fi
.nf
\f3\fP
.fi
.sp
Note
Specifying both \f3m\fR and \f3e\fR options together when a particular manifest also contains the \f3Main-Class\fR attribute results in an ambiguous \f3Main-Class\fR specification\&. The ambiguity leads to an error and the \f3jar\fR command creation or update operation is terminated\&.
.TP
f
Sets the file specified by the \fI\fR\fIjarfile\fR operand to be the name of the JAR file that is created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR) from, or viewed (\f3t\fR)\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
.TP
m
Includes names and values of attributes from the file specified by the \f3manifest\fR operand in the manifest file of the \f3jar\fR command (located in the archive at \f3META-INF/MANIFEST\&.MF\fR)\&. The \f3jar\fR command adds the attribute\(cqs name and value to the JAR file unless an entry already exists with the same name, in which case the \f3jar\fR command updates the value of the attribute\&. The \f3m\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
You can add special-purpose name-value attribute pairs to the manifest that are not contained in the default manifest file\&. For example, you can add attributes that specify vendor information, release information, package sealing, or to make JAR-bundled applications executable\&. For examples of using the \f3m\fR option, see Packaging Programs at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
.TP
M
Does not create a manifest file entry (for \f3c\fR and \f3u\fR), or delete a manifest file entry when one exists (for \f3u\fR)\&. The \f3M\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
.TP
n
When creating (\f3c\fR) a JAR file, this option normalizes the archive so that the content is not affected by the packing and unpacking operations of the pack200(1) command\&. Without this normalization, the signature of a signed JAR can become invalid\&.
.TP
v
Generates verbose output to standard output\&. See Examples\&.
.TP
0
(Zero) Creates (\f3c\fR) or updates (\f3u\fR) the JAR file without using ZIP compression\&.
jar \- create an archive for classes and resources, and manipulate or
restore individual classes or resources from an archive
.SH SYNOPSIS
.PP
\f[CB]jar\f[R] [\f[I]OPTION\f[R] ...] [ [\f[CB]\-\-release\f[R]
\f[I]VERSION\f[R]] [\f[CB]\-C\f[R] \f[I]dir\f[R]] \f[I]files\f[R]] ...
.SH DESCRIPTION
.PP
The \f[CB]jar\f[R] command is a general\-purpose archiving and compression
tool, based on the ZIP and ZLIB compression formats.
Initially, the \f[CB]jar\f[R] command was designed to package Java applets
(not supported since JDK 11) or applications; however, beginning with
JDK 9, users can use the \f[CB]jar\f[R] command to create modular JARs.
For transportation and deployment, it\[aq]s usually more convenient to
package modules as modular JARs.
.PP
The syntax for the \f[CB]jar\f[R] command resembles the syntax for the
\f[CB]tar\f[R] command.
It has several main operation modes, defined by one of the mandatory
operation arguments.
Other arguments are either options that modify the behavior of the
operation or are required to perform the operation.
.PP
When modules or the components of an application (files, images and
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
requiring a new connection for each piece.
This dramatically improves download times.
The \f[CB]jar\f[R] command also compresses files, which further improves
download time.
The \f[CB]jar\f[R] command also enables individual entries in a file to 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
compressed.
.PP
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
the root of the \f[CB]\&.jar\f[R] archive.
The following operations described in \f[B]Operation Modifiers Valid
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:
.IP \[bu] 2
\f[CB]\-\-module\-version\f[R]
.IP \[bu] 2
\f[CB]\-\-hash\-modules\f[R]
.IP \[bu] 2
\f[CB]\-\-module\-path\f[R]
.PP
\f[B]Note:\f[R]
.PP
All mandatory or optional arguments for long options are also mandatory
or optional for any corresponding short options.
.SH MAIN OPERATION MODES
.PP
When using the \f[CB]jar\f[R] command, you must specify the operation for
it to perform.
You specify the operation mode for the \f[CB]jar\f[R] command by including
the appropriate operation arguments described in this section.
You can mix an operation argument with other one\-letter options.
Generally the operation argument is the first argument specified on the
command line.
.TP
-C \fIdir\fR
.br
When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, this option temporarily changes the directory while processing files specified by the \fIfile\fR operands\&. Its operation is intended to be similar to the \f3-C\fR option of the UNIX \f3tar\fR utility\&.For example, the following command changes to the \f3classes\fR directory and adds the \f3Bar\&.class\fR file from that directory to \f3my\&.jar\fR:
.sp
.nf
\f3jar uf my\&.jar \-C classes Bar\&.class\fP
.fi
.nf
\f3\fP
.fi
.sp
The following command changes to the \f3classes\fR directory and adds to \f3my\&.jar\fR all files within the classes directory (without creating a \f3classes\fR directory in the JAR file), then changes back to the original directory before changing to the \f3bin\fR directory to add \f3Xyz\&.class\fR to \f3my\&.jar\fR\&.
.sp
.nf
\f3jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class\fP
.fi
.nf
\f3\fP
.fi
.sp
If \f3classes\fR contained files \f3bar1\fR and \f3bar2\fR, then the JAR file will contain the following after running the previous command:
.sp
.nf
\f3% \fIjar tf my\&.jar\fR\fP
.fi
.nf
\f3META\-INF/\fP
.fi
.nf
\f3META\-INF/MANIFEST\&.MF\fP
.fi
.nf
\f3bar1\fP
.fi
.nf
\f3bar2\fP
.fi
.nf
\f3Xyz\&.class\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
\fI\fR-J\fIoption\fR
Sets the specified JVM option to be used when the JRE runs the JAR file\&. JVM options are described on the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
.SH OPERANDS
The following operands are recognized by the \f3jar\fR command\&.
.TP
\fIfile\fR
When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIfile\fR operand defines the path and name of the file or directory that should be added to the archive\&. When extracting (\f3x\fR) or listing the contents (\f3t\fR) of a JAR file, the \fIfile\fR operand defines the path and name of the file to be extrated or listed\&. At least one valid file or directory must be specified\&. Separate multiple \fIfile\fR operands with spaces\&. If the \fIentrypoint\fR, \fIjarfile\fR, or \fImanifest\fR operands are used, the \fIfile\fR operands must be specified after them\&.
.TP
\fIentrypoint\fR
When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIentrypoint\fR operand defines the name of the class that should be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The \fIentrypoint\fR operand must be specified if the \f3e\fR option is present\&.
.TP
\fIjarfile\fR
Defines the name of the file to be created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR), or viewed (\f3t\fR)\&. The \fIjarfile\fR operand must be specified if the \f3f\fR option is present\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
When indexing (\f3i\fR) a JAR file, specify the \fIjarfile\fR operand without the \f3f\fR option\&.
.TP
\fImanifest\fR
When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fImanifest\fR operand defines the preexisting manifest files with names and values of attributes to be included in \f3MANIFEST\&.MF\fR in the JAR file\&. The \fImanifest\fR operand must be specified if the \f3f\fR option is present\&.
.TP
\fI@arg-file\fR
To shorten or simplify the \f3jar\fR command, you can specify arguments in a separate text file and pass it to the \f3jar\fR command with the at sign (@) as a prefix\&. When the \f3jar\fR command encounters an argument beginning with the at sign, it expands the contents of that file into the argument list\&.
An argument file can include options and arguments of the \f3jar\fR command (except the \f3-J\fR options, because they are passed to the launcher, which does not support argument files)\&. The arguments within a file can be separated by spaces or newline characters\&. File names within an argument file are relative to the current directory from which you run the \f3jar\fR command, not relative to the location of the argument file\&. Wild cards, such as the asterisk (*), that might otherwise be expanded by the operating system shell, are not expanded\&.
The following example, shows how to create a \f3classes\&.list\fR file with names of files from the current directory output by the \f3find\fR command:
.sp
.nf
\f3find \&. \-name \&'*\&.class\&' \-print > classes\&.list\fP
.fi
.nf
\f3\fP
.fi
.sp
You can then execute the \f3jar\fR command and pass the \f3classes\&.list\fR file to it using the \fI@arg-file\fR syntax:
.sp
.nf
\f3jar cf my\&.jar @classes\&.list\fP
.fi
.nf
\f3\fP
.fi
.sp
An argument file can be specified with a path, but any file names inside the argument file that have relative paths are relative to the current working directory of the \f3jar\fR command, not to the path passed in, for example:
.sp
.nf
\f3jar @dir/classes\&.list\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH NOTES
The \f3e\fR, \f3f\fR, and \f3m\fR options must appear in the same order on the command line as the \fIentrypoint\fR, \fIjarfile\fR, and \fImanifest\fR operands, for example:
.sp
.nf
\f3jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH EXAMPLES
\f3Example 1 Adding All Files From the Current Directory With Verbose Output\fR
.sp
.nf
\f3% ls\fP
.fi
.nf
\f31\&.au Animator\&.class monkey\&.jpg\fP
.fi
.nf
\f32\&.au Wave\&.class spacemusic\&.au\fP
.fi
.nf
\f33\&.au at_work\&.gif\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3% jar cvf bundle\&.jar *\fP
.fi
.nf
\f3added manifest\fP
.fi
.nf
\f3adding: 1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
.fi
.nf
\f3adding: 2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
.fi
.nf
\f3adding: 3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
.fi
.nf
\f3adding: Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
.fi
.nf
\f3adding: Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
.fi
.nf
\f3adding: at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
.fi
.nf
\f3adding: monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
.fi
.nf
\f3adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
.fi
.nf
\f3\fP
.fi
.sp
\f3Example 2 Adding Files From Subdirectories\fR
.sp
.nf
\f3% ls \-F\fP
.fi
.nf
\f3audio/ classes/ images/\fP
.fi
.nf
\f3% jar cvf bundle\&.jar audio classes images\fP
.fi
.nf
\f3added manifest\fP
.fi
.nf
\f3adding: audio/(in = 0) (out= 0)(stored 0%)\fP
.fi
.nf
\f3adding: audio/1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
.fi
.nf
\f3adding: audio/2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
.fi
.nf
\f3adding: audio/3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
.fi
.nf
\f3adding: audio/spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
.fi
.nf
\f3adding: classes/(in = 0) (out= 0)(stored 0%)\fP
.fi
.nf
\f3adding: classes/Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
.fi
.nf
\f3adding: classes/Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
.fi
.nf
\f3adding: images/(in = 0) (out= 0)(stored 0%)\fP
.fi
.nf
\f3adding: images/monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
.fi
.nf
\f3adding: images/at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3% ls \-F\fP
.fi
.nf
\f3audio/ bundle\&.jar classes/ images/\fP
.fi
.nf
\f3\fP
.fi
.sp
\f3Example 3 Listing the Contents of JAR\fR
.sp
.nf
\f3% jar tf bundle\&.jar\fP
.fi
.sp
.sp
.nf
\f3META\-INF/\fP
.fi
.nf
\f3META\-INF/MANIFEST\&.MF\fP
.fi
.nf
\f3audio/1\&.au\fP
.fi
.nf
\f3audio/2\&.au\fP
.fi
.nf
\f3audio/3\&.au\fP
.fi
.nf
\f3audio/spacemusic\&.au\fP
.fi
.nf
\f3classes/Animator\&.class\fP
.fi
.nf
\f3classes/Wave\&.class\fP
.fi
.nf
\f3images/monkey\&.jpg\fP
.fi
.nf
\f3images/at_work\&.gif\fP
.fi
.nf
\f3\fP
.fi
.sp
\f3Example 4 Adding an Index\fR
.PP
Use the \f3i\fR option when you split the interdependent classes for a stock trade application into three JAR files: \f3main\&.jar\fR, \f3buy\&.jar\fR, and \f3sell\&.jar\fR\&. If you specify the \f3Class-Path\fR attribute in the \f3main\&.jar\fR manifest, then you can use the \f3i\fR option to speed up the class loading time for your application:
.sp
.nf
\f3Class\-Path: buy\&.jar sell\&.jar\fP
.fi
.nf
\f3jar i main\&.jar\fP
.fi
.nf
\f3\fP
.fi
.sp
An \f3INDEX\&.LIST\fR file is inserted to the \f3META-INF\fR directory\&. This enables the application class loader to download the specified JAR files when it is searching for classes or resources\&.
.PP
The application class loader uses the information stored in this file for efficient class loading\&. To copy directories, first compress files in \f3dir1\fR to \f3stdout\fR, then pipeline and extract from \f3stdin\fR to \f3dir2\fR (omitting the \f3-f\fR option from both \f3jar\fR commands):
.sp
.nf
\f3(cd dir1; jar c \&.) | (cd dir2; jar x)\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH SEE\ ALSO
.TP 0.2i
\(bu
pack200(1)\&.
.TP 0.2i
\(bu
The JAR section of The Java Tutorials at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
.B \f[CB]\-c\f[R] or \f[CB]\-\-create\f[R]
Creates the archive.
.RS
.RE
.TP
.B \f[CB]\-i=\f[R]\f[I]FILE\f[R] or \f[CB]\-\-generate\-index=\f[R]\f[I]FILE\f[R]
Generates index information for the specified JAR file.
.RS
.RE
.TP
.B \f[CB]\-t\f[R] or \f[CB]\-\-list\f[R]
Lists the table of contents for the archive.
.RS
.RE
.TP
.B \f[CB]\-u\f[R] or \f[CB]\-\-update\f[R]
Updates an existing JAR file.
.RS
.RE
.TP
.B \f[CB]\-x\f[R] or \f[CB]\-\-extract\f[R]
Extracts the named (or all) files from the archive.
.RS
.RE
.TP
.B \f[CB]\-d\f[R] or \f[CB]\-\-describe\-module\f[R]
Prints the module descriptor or automatic module name.
.RS
.RE
.SH OPERATION MODIFIERS VALID IN ANY MODE
.PP
You can use the following options to customize the actions of any
operation mode included in the \f[CB]jar\f[R] command.
.TP
.B \f[CB]\-C\f[R] \f[I]DIR\f[R]
Changes the specified directory and includes the \f[I]files\f[R]
specified at the end of the command line.
.RS
.PP
\f[CB]jar\f[R] [\f[I]OPTION\f[R] ...] [ [\f[CB]\-\-release\f[R]
\f[I]VERSION\f[R]] [\f[CB]\-C\f[R] \f[I]dir\f[R]] \f[I]files\f[R]]
.RE
.TP
.B \f[CB]\-f=\f[R]\f[I]FILE\f[R] or \f[CB]\-\-file=\f[R]\f[I]FILE\f[R]
Specifies the archive file name.
.RS
.RE
.TP
.B \f[CB]\-\-release\f[R] \f[I]VERSION\f[R]
Creates a multirelease JAR file.
Places all files specified after the option into a versioned directory
of the JAR file named
\f[CB]META\-INF/versions/\f[R]\f[I]VERSION\f[R]\f[CB]/\f[R], where
\f[I]VERSION\f[R] must be must be a positive integer whose value is 9 or
greater.
.RS
.PP
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
directory tree whose \f[I]VERSION\f[R] number matches the JDK\[aq]s major
version number.
It will then look in directories with successively lower
\f[I]VERSION\f[R] numbers, and finally look in the root of the JAR.
.RE
.TP
.B \f[CB]\-v\f[R] or \f[CB]\-\-verbose\f[R]
Sends or prints verbose output to standard output.
.RS
.RE
.SH OPERATION MODIFIERS VALID ONLY IN CREATE AND UPDATE MODES
.PP
You can use the following options to customize the actions of the create
and the update main operation modes:
.TP
.B \f[CB]\-e=\f[R]\f[I]CLASSNAME\f[R] or \f[CB]\-\-main\-class=\f[R]\f[I]CLASSNAME\f[R]
Specifies the application entry point for standalone applications
bundled into a modular or executable modular JAR file.
.RS
.RE
.TP
.B \f[CB]\-m=\f[R]\f[I]FILE\f[R] or \f[CB]\-\-manifest=\f[R]\f[I]FILE\f[R]
Includes the manifest information from the given manifest file.
.RS
.RE
.TP
.B \f[CB]\-M\f[R] or \f[CB]\-\-no\-manifest\f[R]
Doesn\[aq]t create a manifest file for the entries.
.RS
.RE
.TP
.B \f[CB]\-\-module\-version=\f[R]\f[I]VERSION\f[R]
Specifies the module version, when creating or updating a modular JAR
file, or updating a non\-modular JAR file.
.RS
.RE
.TP
.B \f[CB]\-\-hash\-modules=\f[R]\f[I]PATTERN\f[R]
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
created or a non\-modular JAR file being updated.
.RS
.RE
.TP
.B \f[CB]\-p\f[R] or \f[CB]\-\-module\-path\f[R]
Specifies the location of module dependence for generating the hash.
.RS
.RE
.TP
.B \f[CB]\@\f[R]\f[I]file\f[R]
Reads \f[CB]jar\f[R] options and file names from a text file.
.RS
.RE
.SH OPERATION MODIFIERS VALID ONLY IN CREATE, UPDATE, AND
GENERATE\-INDEX MODES
.PP
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[CB]\-\-update\f[R] ) and the generate\-index (\f[CB]\-i\f[R] or
\f[CB]\-\-generate\-index=\f[R]\f[I]FILE\f[R]) main operation modes:
.TP
.B \f[CB]\-0\f[R] or \f[CB]\-\-no\-compress\f[R]
Stores without using ZIP compression.
.RS
.RE
.SH OTHER OPTIONS
.PP
The following options are recognized by the \f[CB]jar\f[R] command and not
used with operation modes:
.TP
.B \f[CB]\-h\f[R] or \f[CB]\-\-help\f[R][\f[CB]:compat\f[R]]
Displays the command\-line help for the \f[CB]jar\f[R] command or
optionally the compatibility help.
.RS
.RE
.TP
.B \f[CB]\-\-help\-extra\f[R]
Displays help on extra options.
.RS
.RE
.TP
.B \f[CB]\-\-version\f[R]
Prints the program version.
.RS
.RE
.SH EXAMPLES OF JAR COMMAND SYNTAX
.IP \[bu] 2
Create an archive, \f[CB]classes.jar\f[R], that contains two class files,
\f[CB]Foo.class\f[R] and \f[CB]Bar.class\f[R].
.RS 2
.RS
.PP
\f[CB]jar\ \-\-create\ \-\-file\ classes.jar\ Foo.class\ Bar.class\f[R]
.RE
.RE
.IP \[bu] 2
Create an archive, \f[CB]classes.jar\f[R], by using an existing manifest,
\f[CB]mymanifest\f[R], that contains all of the files in the directory
\f[CB]foo/\f[R].
.RS 2
.RS
.PP
\f[CB]jar\ \-\-create\ \-\-file\ classes.jar\ \-\-manifest\ mymanifest\ \-C\ foo/\f[R]
.RE
.RE
.IP \[bu] 2
Create a modular JAR archive,\f[CB]foo.jar\f[R], where the module
descriptor is located in \f[CB]classes/module\-info.class\f[R].
.RS 2
.RS
.PP
\f[CB]jar\ \-\-create\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Main\ \-\-module\-version\ 1.0\ \-C\ foo/classes\ resources\f[R]
.RE
.RE
.IP \[bu] 2
Update an existing non\-modular JAR, \f[CB]foo.jar\f[R], to a modular JAR
file.
.RS 2
.RS
.PP
\f[CB]jar\ \-\-update\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Main\ \-\-module\-version\ 1.0\ \-C\ foo/module\-info.class\f[R]
.RE
.RE
.IP \[bu] 2
Create a versioned or multi\-release JAR, \f[CB]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[CB]classes\-10\f[R] directory in the
\f[CB]META\-INF/versions/10\f[R] directory of the JAR.
.RS 2
.PP
In this example, the \f[CB]classes/com/foo\f[R] directory contains two
classes, \f[CB]com.foo.Hello\f[R] (the entry point class) and
\f[CB]com.foo.NameProvider\f[R], both compiled for JDK 8.
The \f[CB]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
specific code and compiled for JDK 10.
.PP
Given this setup, create a multirelease JAR file \f[CB]foo.jar\f[R] by
running the following command from the directory containing the
directories \f[CB]classes\f[R] and \f[CB]classes\-10\f[R] .
.RS
.PP
\f[CB]jar\ \-\-create\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Hello\ \-C\ classes\ .\ \-\-release\ 10\ \-C\ classes\-10\ .\f[R]
.RE
.PP
The JAR file \f[CB]foo.jar\f[R] now contains:
.IP
.nf
\f[CB]
%\ jar\ \-tf\ foo.jar
META\-INF/
META\-INF/MANIFEST.MF
com/
com/foo/
com/foo/Hello.class
com/foo/NameProvider.class
META\-INF/versions/10/com/
META\-INF/versions/10/com/foo/
META\-INF/versions/10/com/foo/NameProvider.class
\f[R]
.fi
.PP
As well as other information, the file \f[CB]META\-INF/MANIFEST.MF\f[R],
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].
.IP
.nf
\f[CB]
\&...
Main\-Class:\ com.foo.Hello
Multi\-Release:\ true
\f[R]
.fi
.PP
Assuming that the \f[CB]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
will ensure that the \f[CB]com.foo.NameProvider\f[R] class is the one in
\f[CB]META\-INF/versions/10/com/foo/\f[R].
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,
in \f[CB]com/foo\f[R].
.RE
.IP \[bu] 2
Create an archive, \f[CB]my.jar\f[R], by reading options and lists of
class files from the file \f[CB]classes.list\f[R].
.RS 2
.PP
\f[B]Note:\f[R]
.PP
To shorten or simplify the \f[CB]jar\f[R] command, you can specify
arguments in a separate text file and pass it to the \f[CB]jar\f[R]
command with the at sign (\f[CB]\@\f[R]) as a prefix.
.RS
.PP
\f[CB]jar\ \-\-create\ \-\-file\ my.jar\ \@classes.list\f[R]
.RE
.RE
.br
'pl 8.5i
'bp

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

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,113 +19,95 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Troubleshooting Tools
.\" Title: jinfo.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jinfo 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jinfo \- Generates configuration information\&. This command is experimental and unsupported\&.
.SH SYNOPSIS
.sp
.nf
\fBjinfo\fR [ \fIoption\fR ] \fIpid\fR
.fi
.nf
\fBjinfo\fR [ \fIoption \fR] \fIexecutable core\fR
.fi
.nf
\fBjinfo\fR [ \fIoption \fR] \fI[ servier\-id ] remote\-hostname\-or\-IP\fR
.fi
.sp
.TP
\fIoption\fR
The command-line options\&. See Options\&.
.TP
\fIpid\fR
The process ID for which the configuration information is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
.TP
\fIexecutable\fR
The Java executable from which the core dump was produced\&.
.TP
\fIcore\fR
The core file for which the configuration information is to be printed\&.
.TP
\fIremote-hostname-or-IP\fR
The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
.TP
\fIserver-id\fR
An optional unique ID to use when multiple debug servers are running on the same remote host\&.
.SH DESCRIPTION
The \f3jinfo\fR command prints Java configuration information for a specified Java process or core file or a remote debug server\&. The configuration information includes Java system properties and Java Virtual Machine (JVM) command-line flags\&. If the specified process is running on a 64-bit JVM, then you might need to specify the \f3-J-d64\fR option, for example: \f3jinfo\fR\f3-J-d64 -sysprops pid\fR\&.
.TH "JINFO" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
This utility is unsupported and might not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of the jvm\&.dll that is used by the target process or the location from which the crash dump file was produced\&. For example, \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR \&.
.SH OPTIONS
.TP
no-option
Prints both command-line flags and system property name-value pairs\&.
jinfo \- generate Java configuration information for a specified Java
process
.SH SYNOPSIS
.PP
\f[B]Note:\f[R] This command is experimental\ and unsupported.
.PP
\f[CB]jinfo\f[R] [\f[I]option\f[R]] \f[I]pid\f[R]
.TP
-flag \fIname\fR
.br
Prints the name and value of the specified command-line flag\&.
.TP
-flag \fI[+|-]name\fR
.br
enables or disables the specified Boolean command-line flag\&.
.TP
-flag \fIname=value\fR
.br
Sets the specified command-line flag to the specified value\&.
.TP
-flags
.br
Prints command-line flags passed to the JVM\&.
.TP
-sysprops
.br
Prints Java system properties as name-value pairs\&.
.TP
-h
.br
Prints a help message\&.
.TP
-help
.br
Prints a help message\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
jps(1)
.TP 0.2i
\(bu
jsadebugd(1)
.B \f[I]option\f[R]
This represents the \f[CB]jinfo\f[R] command\-line options.
See \f[B]Options for the jinfo Command\f[R].
.RS
.RE
.TP
.B \f[I]pid\f[R]
The process ID for which the configuration information is to be printed.
The process must be a Java process.
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
separate docker instance, the \f[B]jps\f[R] command.
.RS
.PP
\f[B]Note:\f[R] JDK 10 has added support for using the Attach API when
attaching to Java processes running in a separate docker process.
However, the \f[CB]jps\f[R] command will not list the JVM processes that
are running in a separate docker instance.
If you are trying to connect a Linux host with a Virtual Machine that is
in a docker container, you must use tools such as \f[CB]ps\f[R] to look up
the PID of the JVM.
.RE
.SH DESCRIPTION
.PP
The \f[CB]jinfo\f[R] command prints Java configuration information for a
specified Java process.
The configuration information includes Java system properties and JVM
command\-line flags.
If the specified process is running on a 64\-bit JVM, then you might
need to specify the \f[CB]\-J\-d64\f[R] option, for example:
.RS
.PP
\f[CB]jinfo\ \-J\-d64\ \-sysprops\f[R] \f[I]pid\f[R]
.RE
.PP
This command is unsupported and might not be available in future
releases of the JDK.
In Windows Systems where \f[CB]dbgeng.dll\f[R] is not present, the
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[CB]jvm.dll\f[R] that\[aq]s used by the target process or the
location from which the core dump file was produced.
.SH OPTIONS FOR THE JINFO COMMAND
.PP
\f[B]Note:\f[R]
.PP
If none of the following options are used, both the command\-line flags
and the system property name\-value pairs are printed.
.TP
.B \f[CB]\-flag\f[R] \f[I]name\f[R]
Prints the name and value of the specified command\-line flag.
.RS
.RE
.TP
.B \f[CB]\-flag\f[R] [\f[CB]+\f[R]|\f[CB]\-\f[R]]\f[I]name\f[R]
Enables or disables the specified Boolean command\-line flag.
.RS
.RE
.TP
.B \f[CB]\-flag\f[R] \f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R]
Sets the specified command\-line flag to the specified value.
.RS
.RE
.TP
.B \f[CB]\-flags\f[R]
Prints command\-line flags passed to the JVM.
.RS
.RE
.TP
.B \f[CB]\-sysprops\f[R]
Prints Java system properties as name\-value pairs.
.RS
.RE
.TP
.B \f[CB]\-h\f[R] or \f[CB]\-help\f[R]
Prints a help message.
.RS
.RE
.br
'pl 8.5i
'bp

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,124 +19,91 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Troubleshooting Tools
.\" Title: jmap.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jmap 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jmap \- Prints shared object memory maps or heap memory details for a process, core file, or remote debug server\&. This command is experimental and unsupported\&.
.SH SYNOPSIS
.sp
.nf
\fBjmap\fR [ \fIoptions\fR ] \fIpid\fR
.fi
.nf
\fBjmap\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
.fi
.nf
\fBjmap\fR [ \fIoptions\fR ] [ \fIpid\fR ] \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fIpid\fR
The process ID for which the memory map is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
.TP
\fIexecutable\fR
The Java executable from which the core dump was produced\&.
.TP
\fIcore\fR
The core file for which the memory map is to be printed\&.
.TP
\fIremote-hostname-or-IP\fR
The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
.TP
\fIserver-id\fR
An optional unique ID to use when multiple debug servers are running on the same remote host\&.
.SH DESCRIPTION
The \f3jmap\fR command prints shared object memory maps or heap memory details of a specified process, core file, or remote debug server\&. If the specified process is running on a 64-bit Java Virtual Machine (JVM), then you might need to specify the \f3-J-d64\fR option, for example: \f3jmap\fR\f3-J-d64 -heap pid\fR\&.
.TH "JMAP" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
\fINote:\fR This utility is unsupported and might not be available in future releases of the JDK\&. On Windows Systems where the \f3dbgeng\&.dll\fR file is not present, Debugging Tools For Windows must be installed to make these tools work\&. The \f3PATH\fR environment variable should contain the location of the \f3jvm\&.dll\fR file that is used by the target process or the location from which the crash dump file was produced, for example: \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
.SH OPTIONS
.TP
<no option>
When no option is used, the \f3jmap\fR command prints shared object mappings\&. For each shared object loaded in the target JVM, the start address, size of the mapping, and the full path of the shared object file are printed\&. This behavior is similar to the Oracle Solaris \f3pmap\fR utility\&.
jmap \- print details of a specified process
.SH SYNOPSIS
.PP
\f[B]Note:\f[R] This command is experimental\ and unsupported.
.PP
\f[CB]jmap\f[R] [\f[I]options\f[R]] \f[I]pid\f[R]
.TP
-dump:[live,] format=b, file=\fIfilename\fR
.br
Dumps the Java heap in \f3hprof\fR binary format to \f3filename\fR\&. The \f3live\fR suboption is optional, but when specified, only the active objects in the heap are dumped\&. To browse the heap dump, you can use the jhat(1) command to read the generated file\&.
.TP
-finalizerinfo
.br
Prints information about objects that are awaiting finalization\&.
.TP
-heap
.br
Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage\&. In addition, the number and size of interned Strings are printed\&.
.TP
-histo[:live]
.br
Prints a histogram of the heap\&. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed\&. The JVM internal class names are printed with an asterisk (*) prefix\&. If the \f3live\fR suboption is specified, then only active objects are counted\&.
.TP
-clstats
.br
Prints class loader wise statistics of Java heap\&. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed\&.
.TP
-F
.br
Force\&. Use this option with the \f3jmap -dump\fR or \f3jmap -histo\fR option when the pid does not respond\&. The \f3live\fR suboption is not supported in this mode\&.
.TP
-h
.br
Prints a help message\&.
.TP
-help
.br
Prints a help message\&.
.TP
-J\fIflag\fR
.br
Passes \f3flag\fR to the Java Virtual Machine where the \f3jmap\fR command is running\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
jhat(1)
.TP 0.2i
\(bu
jps(1)
.TP 0.2i
\(bu
jsadebugd(1)
.B \f[I]options\f[R]
This represents the \f[CB]jmap\f[R] command\-line options.
See \f[B]Options for the jmap Command\f[R].
.RS
.RE
.TP
.B \f[I]pid\f[R]
The process ID for which the information specified by the
\f[I]options\f[R] is to be printed.
The process must be a Java process.
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
separate docker instance, the \f[B]jps\f[R] command.
.RS
.PP
\f[B]Note:\f[R] JDK 10 has added support for using the Attach API when
attaching to Java processes running in a separate docker process.
However, the \f[CB]jps\f[R] command will not list the JVM processes that
are running in a separate docker instance.
If you are trying to connect a Linux host with a Virtual Machine that is
in a docker container, you must use tools such as \f[CB]ps\f[R] to look up
the PID of the JVM.
.RE
.SH DESCRIPTION
.PP
The \f[CB]jmap\f[R] command prints details of a specified running process.
.PP
\f[B]Note:\f[R]
.PP
This command is unsupported and might not be available in future
releases of the JDK.
On Windows Systems where the \f[CB]dbgeng.dll\f[R] file isn\[aq]t present,
the Debugging Tools for Windows must be installed to make these tools
work.
The \f[CB]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
location from which the core dump file was produced.
.SH OPTIONS FOR THE JMAP COMMAND
.TP
.B \f[CB]\-clstats\f[R] \f[I]pid\f[R]
Connects to a running process and prints class loader statistics of Java
heap.
.RS
.RE
.TP
.B \f[CB]\-finalizerinfo\f[R] \f[I]pid\f[R]
Connects to a running process and prints information on objects awaiting
finalization.
.RS
.RE
.TP
.B \f[CB]\-histo\f[R][\f[CB]:live\f[R]] \f[I]pid\f[R]
Connects to a running process and prints a histogram of the Java object
heap.
If the \f[CB]live\f[R] suboption is specified, it then counts only live
objects.
.RS
.RE
.TP
.B \f[CB]\-dump:\f[R]\f[I]dump_options\f[R] \f[I]pid\f[R]
Connects to a running process and dumps the Java heap.
The \f[I]dump_options\f[R] include:
.RS
.IP \[bu] 2
\f[CB]live\f[R] \-\-\- When specified, dumps only the live objects; if not
specified, then dumps all objects in the heap.
.IP \[bu] 2
\f[CB]format=b\f[R] \-\-\- Dumps the Java heap in \f[CB]hprof\f[R] binary
format
.IP \[bu] 2
\f[CB]file=\f[R]\f[I]filename\f[R] \-\-\- Dumps the heap to
\f[I]filename\f[R]
.PP
Example: \f[CB]jmap\ \-dump:live,format=b,file=heap.bin\f[R] \f[I]pid\f[R]
.RE
.br
'pl 8.5i
'bp

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,185 +19,226 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Monitoring Tools
.\" Title: jps.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
.SH SYNOPSIS
.sp
.nf
\fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
.fi
.sp
.TP
\fIoptions\fR
Command-line options\&. See Options\&.
.TP
\fIhostid\fR
The identifier of the host for which the process report should be generated\&. The \f3hostid\fR can include optional components that indicate the communications protocol, port number, and other implementation specific data\&. See Host Identifier\&.
.SH DESCRIPTION
The \f3jps\fR command lists the instrumented Java HotSpot VMs on the target system\&. The command is limited to reporting information on JVMs for which it has the access permissions\&.
.TH "JPS" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
If the \f3jps\fR command is run without specifying a \f3hostid\fR, then it searches for instrumented JVMs on the local host\&. If started with a \f3hostid\fR, then it searches for JVMs on the indicated host, using the specified protocol and port\&. A \f3jstatd\fR process is assumed to be running on the target host\&.
jps \- list the instrumented JVMs on the target system
.SH SYNOPSIS
.PP
The \f3jps\fR command reports the local JVM identifier, or \f3lvmid\fR, for each instrumented JVM found on the target system\&. The \f3lvmid\fR is typically, but not necessarily, the operating system\&'s process identifier for the JVM process\&. With no options, \f3jps\fR lists each Java application\&'s \f3lvmid\fR followed by the short form of the application\&'s class name or jar file name\&. The short form of the class name or JAR file name omits the class\&'s package information or the JAR files path information\&.
\f[B]Note:\f[R] This command is experimental\ and unsupported.
.PP
The \f3jps\fR command uses the Java launcher to find the class name and arguments passed to the main method\&. If the target JVM is started with a custom launcher, then the class or JAR file name and the arguments to the \f3main\fR method are not available\&. In this case, the \f3jps\fR command outputs the string \f3Unknown\fR for the class name or JAR file name and for the arguments to the \f3main\fR method\&.
\f[CB]jps\f[R] [\f[CB]\-q\f[R]] [\f[CB]\-mlvV\f[R]] [\f[I]hostid\f[R]]
.PP
The list of JVMs produced by the \f3jps\fR command can be limited by the permissions granted to the principal running the command\&. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms\&.
.SH OPTIONS
The \f3jps\fR command supports a number of options that modify the output of the command\&. These options are subject to change or removal in the future\&.
\f[CB]jps\f[R] [\f[CB]\-help\f[R]]
.SH OPTIONS
.TP
-q
.br
Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main\fR method, producing only a list of local JVM identifiers\&.
.B \f[CB]\-q\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 local JVM
identifiers.
.RS
.RE
.TP
-m
.br
Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
.B \f[CB]\-mlvV\f[R]
You can specify any combination of these options.
.RS
.IP \[bu] 2
\f[CB]\-m\f[R] displays the arguments passed to the \f[CB]main\f[R] method.
The output may be \f[CB]null\f[R] for embedded JVMs.
.IP \[bu] 2
\f[CB]\-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
file.
.IP \[bu] 2
\f[CB]\-v\f[R] displays the arguments passed to the JVM.
.IP \[bu] 2
\f[CB]\-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
local JVM identifiers.
.RE
.TP
-l
.br
Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
.B \f[I]hostid\f[R]
The identifier of the host for which the process report should be
generated.
The \f[CB]hostid\f[R] can include optional components that indicate the
communications protocol, port number, and other implementation specific
data.
See \f[B]Host Identifier\f[R].
.RS
.RE
.TP
-v
.br
Displays the arguments passed to the JVM\&.
.TP
-V
.br
Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local JVM identifiers\&.
.TP
-J\f3option\fR
.br
Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.SH HOST\ IDENTIFIER
The host identifier, or \f3hostid\fR is a string that indicates the target system\&. The syntax of the \f3hostid\fR string corresponds to the syntax of a URI:
.sp
.nf
\f3[protocol:][[//]hostname][:port][/servername]\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
\fIprotocol\fR
The communications protocol\&. If the \f3protocol\fR is omitted and a \f3hostname\fR is not specified, then the default protocol is a platform-specific, optimized, local protocol\&. If the protocol is omitted and a host name is specified, then the default protocol is \f3rmi\fR\&.
.TP
hostname
A hostname or IP address that indicates the target host\&. If you omit the \f3hostname\fR parameter, then the target host is the local host\&.
.TP
port
The default port for communicating with the remote server\&. If the \f3hostname\fR parameter is omitted or the \f3protocol\fR parameter specifies an optimized, local protocol, then the \f3port\fR parameter is ignored\&. Otherwise, treatment of the \f3port\fR parameter is implementation specific\&. For the default \f3rmi\fR protocol, the \f3port\fR parameter indicates the port number for the rmiregistry on the remote host\&. If the \f3port\fR parameter is omitted, and the \f3protocol\fR parameter indicates \f3rmi\fR, then the default rmiregistry port (1099) is used\&.
.TP
servername
The treatment of this parameter depends on the implementation\&. For the optimized, local protocol, this field is ignored\&. For the \f3rmi\fR protocol, this parameter is a string that represents the name of the RMI remote object on the remote host\&. See the \f3jstatd\fR command \f3-n\fRoption for more information\&.
.SH OUTPUT\ FORMAT
The output of the \f3jps\fR command follows the following pattern:
.sp
.nf
\f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
.fi
.nf
\f3\fP
.fi
.sp
All output tokens are separated by white space\&. An \f3arg\fR value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters\&.
.B \f[CB]\-help\f[R]
Displays the help message for the \f[CB]jps\f[R] command.
.RS
.RE
.SH DESCRIPTION
.PP
\fINote:\fR It is recommended that you do not write scripts to parse \f3jps\fR output because the format might change in future releases\&. If you write scripts that parse \f3jps\fR output, then expect to modify them for future releases of this tool\&.
.SH EXAMPLES
This section provides examples of the \f3jps\fR command\&.
The \f[CB]jps\f[R] command lists the instrumented Java HotSpot VMs on the
target system.
The command is limited to reporting information on JVMs for which it has
the access permissions.
.PP
\f[B]Note:\f[R]
.PP
JDK 10 added support for using the Attach API when attaching to Java
processes running in a separate docker process.
However, the \f[CB]jps\f[R] tool cannot see JVM processes running in a
separate docker instance.
If you are trying to connect a Linux host with a Virtual Machine within
a docker container, you must use tools such as \f[CB]ps\f[R] to look up
the PID of the JVM and then specify the PID on the command line of the
tools that accept the PID.
.PP
If the \f[CB]jps\f[R] command is run without specifying a \f[CB]hostid\f[R],
then it searches for instrumented JVMs on the local host.
If started with a \f[CB]hostid\f[R], then it searches for JVMs on the
indicated host, using the specified protocol and port.
A \f[CB]jstatd\f[R] process is assumed to be running on the target host.
.PP
The \f[CB]jps\f[R] command reports the local JVM identifier, or
\f[CB]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
system\[aq]s process identifier for the JVM process.
With no options, the \f[CB]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 class name or jar file name.
The short form of the class name or JAR file name omits the class\[aq]s
package information or the JAR files path information.
.PP
The \f[CB]jps\f[R] command uses the Java launcher to find the class name
and arguments passed to the main method.
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
available.
In this case, the \f[CB]jps\f[R] command outputs the string
\f[CB]Unknown\f[R] for the class name, or JAR file name, and for the
arguments to the \f[CB]main\f[R] method.
.PP
The list of JVMs produced by the \f[CB]jps\f[R] command can be limited by
the permissions granted to the principal running the command.
The command lists only the JVMs for which the principal has access
rights as determined by operating system\-specific access control
mechanisms.
.SH HOST IDENTIFIER
.PP
The host identifier, or \f[CB]hostid\f[R], is a string that indicates the
target system.
The syntax of the \f[CB]hostid\f[R] string corresponds to the syntax of a
URI:
.RS
.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]]
.RE
.TP
.B \f[I]protocol\f[R]
The communications protocol.
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,
local protocol.
If the protocol is omitted and a host name is specified, then the
default protocol is \f[CB]rmi\f[R].
.RS
.RE
.TP
.B \f[I]hostname\f[R]
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
local host.
.RS
.RE
.TP
.B \f[I]port\f[R]
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]
parameter specifies an optimized, local protocol, then the \f[I]port\f[R]
parameter is ignored.
Otherwise, treatment of the \f[I]port\f[R] parameter is
implementation\-specific.
For the default \f[CB]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
host.
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]
port (\f[CB]1099\f[R]) is used.
.RS
.RE
.TP
.B \f[I]servername\f[R]
The treatment of this parameter depends on the implementation.
For the optimized, local protocol, this field is ignored.
For the \f[CB]rmi\f[R] protocol, this parameter is a string that
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.
.RS
.RE
.SH OUTPUT FORMAT OF THE JPS COMMAND
.PP
The output of the \f[CB]jps\f[R] command has the following pattern:
.RS
.PP
\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]* ] ]
.RE
.PP
All output tokens are separated by white space.
An \f[CB]arg\f[R] value that includes embedded white space introduces
ambiguity when attempting to map arguments to their actual positional
parameters.
.PP
\f[B]Note:\f[R]
.PP
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.
If you write scripts that parse \f[CB]jps\f[R] output, then expect to
modify them for future releases of this tool.
.SH EXAMPLES
.PP
This section provides examples of the \f[CB]jps\f[R] command.
.PP
List the instrumented JVMs on the local host:
.sp
.nf
\f3jps\fP
.fi
.nf
\f318027 Java2Demo\&.JAR\fP
.fi
.nf
\f318032 jps\fP
.fi
.nf
\f318005 jstat\fP
.fi
.nf
\f3\fP
.fi
.sp
The following example lists the instrumented JVMs on a remote host\&. This example assumes that the \f3jstat\fR server and either the its internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099)\&. It also assumes that the local host has appropriate permissions to access the remote host\&. This example also includes the \f3-l\fR option to output the long form of the class names or JAR file names\&.
.sp
.nf
\f3jps \-l remote\&.domain\fP
.fi
.nf
\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
.fi
.nf
\f32857 sun\&.tools\&.jstatd\&.jstatd\fP
.fi
.nf
\f3\fP
.fi
.sp
The following example lists the instrumented JVMs on a remote host with a non-default port for the RMI registry\&. This example assumes that the \f3jstatd\fR server, with an internal RMI registry bound to port 2002, is running on the remote host\&. This example also uses the \f3-m\fR option to include the arguments passed to the \f3main\fR method of each of the listed Java applications\&.
.sp
.nf
\f3jps \-m remote\&.domain:2002\fP
.fi
.nf
\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
.fi
.nf
\f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH SEE\ ALSO
.TP 0.2i
\(bu
java(1)
.TP 0.2i
\(bu
jstat(1)
.TP 0.2i
\(bu
jstatd(1)
.TP 0.2i
\(bu
rmiregistry(1)
.RE
.br
'pl 8.5i
'bp
.IP
.nf
\f[CB]
jps
18027\ Java2Demo.JAR
18032\ jps
18005\ jstat
\f[R]
.fi
.PP
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
internal RMI registry or a separate external \f[CB]rmiregistry\f[R]
process are running on the remote host on the default port (port
\f[CB]1099\f[R]).
It also assumes that the local host has appropriate permissions to
access the remote host.
This example includes the \f[CB]\-l\f[R] option to output the long form of
the class names or JAR file names.
.IP
.nf
\f[CB]
jps\ \-l\ remote.domain
3002\ /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
2857\ sun.tools.jstatd.jstatd
\f[R]
.fi
.PP
The following example lists the instrumented JVMs on a remote host with
a nondefault port for the RMI registry.
This example assumes that the \f[CB]jstatd\f[R] server, with an internal
RMI registry bound to port \f[CB]2002\f[R], is running on the remote host.
This example also uses the \f[CB]\-m\f[R] option to include the arguments
passed to the \f[CB]main\f[R] method of each of the listed Java
applications.
.IP
.nf
\f[CB]
jps\ \-m\ remote.domain:2002
3002\ /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
3102\ sun.tools.jstatd.jstatd\ \-p\ 2002
\f[R]
.fi

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,118 +19,73 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Troubleshooting Tools
.\" Title: jstack.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jstack 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jstack \- Prints Java thread stack traces for a Java process, core file, or remote debug server\&. This command is experimental and unsupported\&.
.SH SYNOPSIS
.sp
.nf
\fBjstack\fR [ \fIoptions\fR ] \fIpid\fR
.fi
.nf
\fBjstack\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
.fi
.nf
\fBjstack\fR [ \fIoptions\fR ] [ \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fIpid\fR
The process ID for which the stack trace is printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
.TP
\fIexecutable\fR
The Java executable from which the core dump was produced\&.
.TP
\fIcore\fR
The core file for which the stack trace is to be printed\&.
.TP
\fIremote-hostname-or-IP\fR
The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
.TP
\fIserver-id\fR
An optional unique ID to use when multiple debug servers are running on the same remote host\&.
.SH DESCRIPTION
The \f3jstack\fR command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server\&. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed\&. With the \f3-m\fR option, the \f3jstack\fR command prints both Java and native frames of all threads with the program counter (PC)\&. For each native frame, the closest native symbol to PC, when available, is printed\&. C++ mangled names are not demangled\&. To demangle C++ names, the output of this command can be piped to \f3c++filt\fR\&. When the specified process is running on a 64-bit Java Virtual Machine, you might need to specify the \f3-J-d64\fR option, for example: \f3jstack -J-d64 -m pid\fR\&.
.TH "JSTACK" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
\fINote:\fR This utility is unsupported and might not be available in future release of the JDK\&. In Windows Systems where the dbgeng\&.dll file is not present, Debugging Tools For Windows must be installed so these tools work\&. The \f3PATH\fR environment variable needs to contain the location of the jvm\&.dll that is used by the target process, or the location from which the crash dump file was produced\&. For example:
.sp
.nf
\f3set PATH=<jdk>\ejre\ebin\eclient;%PATH%\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH OPTIONS
jstack \- print Java stack traces of Java threads for a specified Java
process
.SH SYNOPSIS
.PP
\f[B]Note:\f[R] This command is experimental\ and unsupported.
.PP
\f[CB]jstack\f[R] [\f[I]options\f[R]] \f[I]pid\f[R]
.TP
-F
.br
Force a stack dump when \f3jstack\fR [\f3-l\fR] \f3pid\fR does not respond\&.
.TP
-l
.br
Long listing\&. Prints additional information about locks such as a list of owned \f3java\&.util\&.concurrent\fR ownable synchronizers\&. See the \f3AbstractOwnableSynchronizer\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.html
.TP
-m
.br
Prints a mixed mode stack trace that has both Java and native C/C++ frames\&.
.TP
-h
.br
Prints a help message\&.
.TP
-help
.br
Prints a help message\&.
.SH KNOWN\ BUGS
In mixed mode stack trace, the \f3-m\fR option does not work with the remote debug server\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
pstack(1)
.TP 0.2i
\(bu
C++filt(1)
.TP 0.2i
\(bu
jps(1)
.TP 0.2i
\(bu
jsadebugd(1)
.B \f[I]options\f[R]
This represents the \f[CB]jstack\f[R] command\-line options.
See \f[B]Options for the jstack Command\f[R].
.RS
.RE
.TP
.B \f[I]pid\f[R]
The process ID for which the stack trace is printed.
The process must be a Java process.
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
separate docker instance, the \f[B]jps\f[R] command.
.RS
.PP
\f[B]Note:\f[R] JDK 10 has added support for using the Attach API when
attaching to Java processes running in a separate docker process.
However, the \f[CB]jps\f[R] command will not list the JVM processes that
are running in a separate docker instance.
If you are trying to connect a Linux host with a Virtual Machine that is
in a docker container, you must use tools such as \f[CB]ps\f[R] to look up
the PID of the JVM.
.RE
.SH DESCRIPTION
.PP
The \f[CB]jstack\f[R] command prints Java stack traces of Java threads for
a specified Java process.
For each Java frame, the full class name, method name, byte code index
(BCI), and line number, when available, are printed.
C++ mangled names aren\[aq]t demangled.
To demangle C++ names, the output of this command can be piped to
\f[CB]c++filt\f[R].
When the specified process is running on a 64\-bit JVM, you might need
to specify the \f[CB]\-J\-d64\f[R] option, for example:
\f[CB]jstack\ \-J\-d64\f[R] \f[I]pid\f[R].
.PP
\f[B]Note:\f[R]
.PP
This command is unsupported and might not be available in future
releases of the JDK.
In Windows Systems where the \f[CB]dbgeng.dll\f[R] file isn\[aq]t present,
the Debugging Tools for Windows must be installed so that these tools
work.
The \f[CB]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
from which the core dump file was produced.
.SH OPTIONS FOR THE JSTACK COMMAND
.TP
.B \f[CB]\-l\f[R]
The long listing option prints additional information about locks.
.RS
.RE
.TP
.B \f[CB]\-h\f[R] or \f[CB]\-help\f[R]
Prints a help message.
.RS
.RE
.br
'pl 8.5i
'bp

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,93 +19,84 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Java Troubleshooting, Profiling, Monitoring and Management Tools
.\" Title: jconsole.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jconsole 1 "21 November 2013" "JDK 8" "Java Troubleshooting, Profiling, Monitoring and Management Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jconsole \- Starts a graphical console that lets you monitor and manage Java applications\&.
.SH SYNOPSIS
.sp
.nf
\fBjconsole\fR [ \fIoptions\fR ] [ connection \&.\&.\&. ]
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR
The \f3pid\fR value is the process ID of a local Java Virtual Machine (JVM)\&. The JVM must be running with the same user ID as the user ID running the \f3jconsole\fR command\&.The \f3host:port\fR values are the name of the host system on which the JVM is running, and the port number specified by the system property \f3com\&.sun\&.management\&.jmxremote\&.port\fR when the JVM was started\&.The \f3jmxUrl\fR value is the address of the JMX agent to be connected to as described in JMXServiceURL\&.
For more information about the \f3connection\fR parameter, see Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
See also the \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
.SH DESCRIPTION
The \f3jconsole\fR command starts a graphical console tool that lets you monitor and manage Java applications and virtual machines on a local or remote machine\&.
.TH "JCONSOLE" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
On Windows, the \f3jconsole\fR command does not associate with a console window\&. It does, however, display a dialog box with error information when the \f3jconsole\fR command fails\&.
.SH OPTIONS
jconsole \- start a graphical console to monitor and manage Java
applications
.SH SYNOPSIS
.PP
\f[CB]jconsole\f[R] [\f[CB]\-interval=\f[R]\f[I]n\f[R]] [\f[CB]\-notile\f[R]]
[\f[CB]\-plugin\f[R] \f[I]path\f[R]] [\f[CB]\-version\f[R]]
[\f[I]connection\f[R] ...
] [\f[CB]\-J\f[R]\f[I]input_arguments\f[R]]
.PP
\f[CB]jconsole\f[R] \f[CB]\-help\f[R]
.SH OPTIONS
.TP
-interval\fI=n\fR
.br
Sets the update interval to \fIn\fR seconds (default is 4 seconds)\&.
.TP
-notile
.br
Does not tile windows initially (for two or more connections)\&.
.TP
-pluginpath \fIplugins\fR
.br
Specifies a list of directories or JAR files to be searched for \f3JConsole\fR plug-ins\&. The \fIplugins\fR path should contain a provider-configuration file named \f3META-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR that contains one line for each plug-in\&. The line specifies the fully qualified class name of the class implementing the \f3com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR class\&.
.TP
-version
.br
Displays release information and exits\&.
.TP
-help
.br
Displays a help message\&.
.TP
-J\fIflag\fR
.br
Passes \f3flag\fR to the JVM on which the \f3jconsole\fR command is run\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
Using JConsole at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html
.TP 0.2i
\(bu
Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
.TP 0.2i
\(bu
The \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
.B \f[CB]\-interval\f[R]
Sets the update interval to \f[CB]n\f[R] seconds (default is 4 seconds).
.RS
.RE
.br
'pl 8.5i
'bp
.TP
.B \f[CB]\-notile\f[R]
Doesn\[aq]t tile the windows for two or more connections.
.RS
.RE
.TP
.B \f[CB]\-pluginpath\f[R] \f[I]path\f[R]
Specifies the path that \f[CB]jconsole\f[R] uses to look up plug\-ins.
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]
that contains one line for each plug\-in.
The line specifies the fully qualified class name of the class
implementing the \f[CB]com.sun.tools.jconsole.JConsolePlugin\f[R] class.
.RS
.RE
.TP
.B \f[CB]\-version\f[R]
Prints the program version.
.RS
.RE
.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]
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].
.RS
.IP \[bu] 2
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
\f[CB]jconsole\f[R] command.
.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
system on which the JVM is running, and the port number specified by the
system property \f[CB]com.sun.management.jmxremote.port\f[R] when the JVM
was started.
.IP \[bu] 2
The \f[I]jmxUrl\f[R] value is the address of the JMX agent to be
connected to as described in JMXServiceURL.
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]input_arguments\f[R]
Passes \f[I]input_arguments\f[R] to the JVM on which the
\f[CB]jconsole\f[R] command is run.
.RS
.RE
.TP
.B \f[CB]\-help\f[R] or \f[CB]\-\-help\f[R]
Displays the help message for the command.
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]jconsole\f[R] command starts a graphical console tool that lets
you monitor and manage Java applications and virtual machines on a local
or remote machine.
.PP
On Windows, the \f[CB]jconsole\f[R] command doesn\[aq]t associate with a
console window.
It does, however, display a dialog box with error information when the
\f[CB]jconsole\f[R] command fails.

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,361 +19,257 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Title: javap
.\" Language: English
.\" Date: 8 August 2014
.\" SectDesc: Basic Tools
.\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-03
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH "javap" "1" "8 August 2014" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
javap \- Disassembles one or more class files\&.
.SH "SYNOPSIS"
.sp
.if n \{\
.RS 4
.\}
.TH "JAVAP" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
javap \- disassemble one or more class files
.SH SYNOPSIS
.PP
\f[CB]javap\f[R] [\f[I]options\f[R]] \f[I]classes\f[R]...
.TP
.B \f[I]options\f[R]
Specifies the command\-line options.
See \f[B]Options for javap\f[R].
.RS
.RE
.TP
.B \f[I]classes\f[R]
Specifies one or more classes separated by spaces to be processed for
annotations.
You can specify a class that can be found in the class path by its file
name, URL, or by its fully qualified class name.
.RS
.PP
Examples:
.RS
.PP
\f[CB]path/to/MyClass.class\f[R]
.RE
.RS
.PP
\f[CB]jar:file:///path/to/MyJar.jar!/mypkg/MyClass.class\f[R]
.RE
.RS
.PP
\f[CB]java.lang.Object\f[R]
.RE
.RE
.SH DESCRIPTION
.PP
The \f[CB]javap\f[R] command disassembles one or more class files.
The output depends on the options used.
When no options are used, the \f[CB]javap\f[R] command prints the
protected and public fields, and methods of the classes passed to it.
.PP
The \f[CB]javap\f[R] command isn\[aq]t multirelease JAR aware.
Using the class path form of the command results in viewing the base
entry in all JAR files, multirelease or not.
Using the URL form, you can use the URL form of an argument to specify a
specific version of a class to be disassembled.
.PP
The \f[CB]javap\f[R] command prints its output to \f[CB]stdout\f[R].
.PP
\f[B]Note:\f[R]
.PP
In tools that support \f[CB]\-\-\f[R] style options, the GNU\-style
options can use the equal sign (\f[CB]=\f[R]) instead of a white space to
separate the name of an option from its value.
.SH OPTIONS FOR JAVAP
.TP
.B \f[CB]\-help\f[R], \f[CB]\-\-help\f[R] , or \f[CB]\-?\f[R]
Prints a help message for the \f[CB]javap\f[R] command.
.RS
.RE
.TP
.B \f[CB]\-version\f[R]
Prints release information.
.RS
.RE
.TP
.B \f[CB]\-verbose\f[R] or \f[CB]\-v\f[R]
Prints additional information about the selected class.
.RS
.RE
.TP
.B \f[CB]\-l\f[R]
Prints line and local variable tables.
.RS
.RE
.TP
.B \f[CB]\-public\f[R]
Shows only public classes and members.
.RS
.RE
.TP
.B \f[CB]\-protected\f[R]
Shows only protected and public classes and members.
.RS
.RE
.TP
.B \f[CB]\-package\f[R]
Shows package/protected/public classes and members (default).
.RS
.RE
.TP
.B \f[CB]\-private\f[R] or \f[CB]\-p\f[R]
Shows all classes and members.
.RS
.RE
.TP
.B \f[CB]\-c\f[R]
Prints disassembled code, for example, the instructions that comprise
the Java bytecodes, for each of the methods in the class.
.RS
.RE
.TP
.B \f[CB]\-s\f[R]
Prints internal type signatures.
.RS
.RE
.TP
.B \f[CB]\-sysinfo\f[R]
Shows system information (path, size, date, MD5 hash) of the class being
processed.
.RS
.RE
.TP
.B \f[CB]\-constants\f[R]
Shows \f[CB]static\ final\f[R] constants.
.RS
.RE
.TP
.B \f[CB]\-\-module\f[R] \f[I]module\f[R] or \f[CB]\-m\f[R] \f[I]module\f[R]
Specifies the module containing classes to be disassembled.
.RS
.RE
.TP
.B \f[CB]\-\-module\-path\f[R] \f[I]path\f[R]
Specifies where to find application modules.
.RS
.RE
.TP
.B \f[CB]\-\-system\f[R] \f[I]jdk\f[R]
Specifies where to find system modules.
.RS
.RE
.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]
Specifies the path that the \f[CB]javap\f[R] command uses to find user
class files.
It overrides the default or the \f[CB]CLASSPATH\f[R] environment variable
when it\[aq]s set.
.RS
.RE
.TP
.B \f[CB]\-bootclasspath\f[R] \f[I]path\f[R]
Overrides the location of bootstrap class files.
.RS
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]option\f[R]
Passes the specified option to the JVM.
For example:
.RS
.IP
.nf
\fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&.
\f[CB]
javap\ \-J\-version
javap\ \-J\-Djava.security.manager\ \-J\-Djava.security.policy=MyPolicy\ MyClassName
\f[R]
.fi
.if n \{\
.PP
See \f[I]Overview of Java Options\f[R] in \f[B]java\f[R].
.RE
.\}
.SH JAVAP EXAMPLE
.PP
\fIoptions\fR
.RS 4
The command\-line options\&. See Options\&.
.RE
.PP
\fIclassfile\fR
.RS 4
One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as
\fBfile:///home/user/myproject/src/DocFooter\&.class\fR\&.
.RE
.SH "DESCRIPTION"
.PP
The
\fBjavap\fR
command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the
\fBjavap\fR
command prints the package, protected and public fields, and methods of the classes passed to it\&. The
\fBjavap\fR
command prints its output to
\fBstdout\fR\&.
.SH "OPTIONS"
.PP
\-help
.br
\-\-help
.br
\-?
.RS 4
Prints a help message for the
\fBjavap\fR
command\&.
.RE
.PP
\-version
.RS 4
Prints release information\&.
.RE
.PP
\-l
.RS 4
Prints line and local variable tables\&.
.RE
.PP
\-public
.RS 4
Shows only public classes and members\&.
.RE
.PP
\-protected
.RS 4
Shows only protected and public classes and members\&.
.RE
.PP
\-private
.br
\-p
.RS 4
Shows all classes and members\&.
.RE
.PP
\-J\fIoption\fR
.RS 4
Passes the specified option to the JVM\&. For example:
.sp
.if n \{\
.RS 4
.\}
Compile the following \f[CB]HelloWorldFrame\f[R] class:
.IP
.nf
\fBjavap \-J\-version\fR
\fBjavap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fR
\f[CB]
import\ java.awt.Graphics;
import\ javax.swing.JFrame;
import\ javax.swing.JPanel;
public\ class\ HelloWorldFrame\ extends\ JFrame\ {
\ \ \ String\ message\ =\ "Hello\ World!";
\ \ \ public\ HelloWorldFrame(){
\ \ \ \ \ \ \ \ setContentPane(new\ JPanel(){
\ \ \ \ \ \ \ \ \ \ \ \ \@Override
\ \ \ \ \ \ \ \ \ \ \ \ protected\ void\ paintComponent(Graphics\ g)\ {
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ g.drawString(message,\ 15,\ 30);
\ \ \ \ \ \ \ \ \ \ \ \ }
\ \ \ \ \ \ \ \ });
\ \ \ \ \ \ \ \ setSize(100,\ 100);
\ \ \ \ }
\ \ \ \ public\ static\ void\ main(String[]\ args)\ {
\ \ \ \ \ \ \ \ HelloWorldFrame\ frame\ =\ new\ HelloWorldFrame();
\ \ \ \ \ \ \ \ frame.setVisible(true);
\ \ \ \ }
}
\f[R]
.fi
.if n \{\
.RE
.\}
For more information about JVM options, see the command documentation\&.
.RE
.PP
\-s
.RS 4
Prints internal type signatures\&.
.RE
.PP
\-sysinfo
.RS 4
Shows system information (path, size, date, MD5 hash) of the class being processed\&.
.RE
.PP
\-constants
.RS 4
Shows
\fBstatic final\fR
constants\&.
.RE
.PP
\-c
.RS 4
Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&.
.RE
.PP
\-verbose
.RS 4
Prints stack size, number of locals and arguments for methods\&.
.RE
.PP
\-classpath \fIpath\fR
.RS 4
Specifies the path the
\fBjavap\fR
command uses to look up classes\&. Overrides the default or the
\fBCLASSPATH\fR
environment variable when it is set\&.
.RE
.PP
\-bootclasspath \fIpath\fR
.RS 4
Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in
\fBjre/lib/rt\&.jar\fR
and several other JAR files\&.
.RE
.PP
\-extdir \fIdirs\fR
.RS 4
Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of
\fBjava\&.ext\&.dirs\fR\&.
.RE
.SH "EXAMPLE"
.PP
Compile the following
\fBDocFooter\fR
class:
.sp
.if n \{\
.RS 4
.\}
The output from the \f[CB]javap\ HelloWorldFrame.class\f[R] command yields
the following:
.IP
.nf
\fBimport java\&.awt\&.*;\fR
\fBimport java\&.applet\&.*;\fR
\fB \fR
\fBpublic class DocFooter extends Applet {\fR
\fB String date;\fR
\fB String email;\fR
\fB \fR
\fB public void init() {\fR
\fB resize(500,100);\fR
\fB date = getParameter("LAST_UPDATED");\fR
\fB email = getParameter("EMAIL");\fR
\fB }\fR
\fB \fR
\fB public void paint(Graphics g) {\fR
\fB g\&.drawString(date + " by ",100, 15);\fR
\fB g\&.drawString(email,290,15);\fR
\fB }\fR
\fB}\fR
\f[CB]
Compiled\ from\ "HelloWorldFrame.java"
public\ class\ HelloWorldFrame\ extends\ javax.swing.JFrame\ {
\ \ java.lang.String\ message;
\ \ public\ HelloWorldFrame();
\ \ public\ static\ void\ main(java.lang.String[]);
}
\f[R]
.fi
.if n \{\
.RE
.\}
.PP
The output from the
\fBjavap DocFooter\&.class\fR
command yields the following:
.sp
.if n \{\
.RS 4
.\}
The output from the \f[CB]javap\ \-c\ HelloWorldFrame.class\f[R] command
yields the following:
.IP
.nf
\fBCompiled from "DocFooter\&.java"\fR
\fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
\fB java\&.lang\&.String date;\fR
\fB java\&.lang\&.String email;\fR
\fB public DocFooter();\fR
\fB public void init();\fR
\fB public void paint(java\&.awt\&.Graphics);\fR
\fB}\fR
\f[CB]
Compiled\ from\ "HelloWorldFrame.java"
public\ class\ HelloWorldFrame\ extends\ javax.swing.JFrame\ {
\ \ java.lang.String\ message;
\ \ public\ HelloWorldFrame();
\ \ \ \ Code:
\ \ \ \ \ \ \ 0:\ aload_0
\ \ \ \ \ \ \ 1:\ invokespecial\ #1\ \ \ \ \ \ \ \ //\ Method\ javax/swing/JFrame."<init>":()V
\ \ \ \ \ \ \ 4:\ aload_0
\ \ \ \ \ \ \ 5:\ ldc\ \ \ \ \ \ \ \ \ \ \ #2\ \ \ \ \ \ \ \ //\ String\ Hello\ World!
\ \ \ \ \ \ \ 7:\ putfield\ \ \ \ \ \ #3\ \ \ \ \ \ \ \ //\ Field\ message:Ljava/lang/String;
\ \ \ \ \ \ 10:\ aload_0
\ \ \ \ \ \ 11:\ new\ \ \ \ \ \ \ \ \ \ \ #4\ \ \ \ \ \ \ \ //\ class\ HelloWorldFrame$1
\ \ \ \ \ \ 14:\ dup
\ \ \ \ \ \ 15:\ aload_0
\ \ \ \ \ \ 16:\ invokespecial\ #5\ \ \ \ \ \ \ \ //\ Method\ HelloWorldFrame$1."<init>":(LHelloWorldFrame;)V
\ \ \ \ \ \ 19:\ invokevirtual\ #6\ \ \ \ \ \ \ \ //\ Method\ setContentPane:(Ljava/awt/Container;)V
\ \ \ \ \ \ 22:\ aload_0
\ \ \ \ \ \ 23:\ bipush\ \ \ \ \ \ \ \ 100
\ \ \ \ \ \ 25:\ bipush\ \ \ \ \ \ \ \ 100
\ \ \ \ \ \ 27:\ invokevirtual\ #7\ \ \ \ \ \ \ \ //\ Method\ setSize:(II)V
\ \ \ \ \ \ 30:\ return
\ \ public\ static\ void\ main(java.lang.String[]);
\ \ \ \ Code:
\ \ \ \ \ \ \ 0:\ new\ \ \ \ \ \ \ \ \ \ \ #8\ \ \ \ \ \ \ \ //\ class\ HelloWorldFrame
\ \ \ \ \ \ \ 3:\ dup
\ \ \ \ \ \ \ 4:\ invokespecial\ #9\ \ \ \ \ \ \ \ //\ Method\ "<init>":()V
\ \ \ \ \ \ \ 7:\ astore_1
\ \ \ \ \ \ \ 8:\ aload_1
\ \ \ \ \ \ \ 9:\ iconst_1
\ \ \ \ \ \ 10:\ invokevirtual\ #10\ \ \ \ \ \ \ //\ Method\ setVisible:(Z)V
\ \ \ \ \ \ 13:\ return
}
\f[R]
.fi
.if n \{\
.RE
.\}
.PP
The output from
\fBjavap \-c DocFooter\&.class\fR
command yields the following:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBCompiled from "DocFooter\&.java"\fR
\fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
\fB java\&.lang\&.String date;\fR
\fB java\&.lang\&.String email;\fR
\fB public DocFooter();\fR
\fB Code:\fR
\fB 0: aload_0 \fR
\fB 1: invokespecial #1 // Method\fR
\fBjava/applet/Applet\&."<init>":()V\fR
\fB 4: return \fR
\fB public void init();\fR
\fB Code:\fR
\fB 0: aload_0 \fR
\fB 1: sipush 500\fR
\fB 4: bipush 100\fR
\fB 6: invokevirtual #2 // Method resize:(II)V\fR
\fB 9: aload_0 \fR
\fB 10: aload_0 \fR
\fB 11: ldc #3 // String LAST_UPDATED\fR
\fB 13: invokevirtual #4 // Method\fR
\fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
\fB 16: putfield #5 // Field date:Ljava/lang/String;\fR
\fB 19: aload_0 \fR
\fB 20: aload_0 \fR
\fB 21: ldc #6 // String EMAIL\fR
\fB 23: invokevirtual #4 // Method\fR
\fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
\fB 26: putfield #7 // Field email:Ljava/lang/String;\fR
\fB 29: return \fR
\fB public void paint(java\&.awt\&.Graphics);\fR
\fB Code:\fR
\fB 0: aload_1 \fR
\fB 1: new #8 // class java/lang/StringBuilder\fR
\fB 4: dup \fR
\fB 5: invokespecial #9 // Method\fR
\fB java/lang/StringBuilder\&."<init>":()V\fR
\fB 8: aload_0 \fR
\fB 9: getfield #5 // Field date:Ljava/lang/String;\fR
\fB 12: invokevirtual #10 // Method\fR
\fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\fB 15: ldc #11 // String by \fR
\fB 17: invokevirtual #10 // Method\fR
\fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\fB 20: invokevirtual #12 // Method\fR
\fB java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fR
\fB 23: bipush 100\fR
\fB 25: bipush 15\fR
\fB 27: invokevirtual #13 // Method\fR
\fB java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
\fB 30: aload_1 \fR
\fB 31: aload_0 \fR
\fB 32: getfield #7 // Field email:Ljava/lang/String;\fR
\fB 35: sipush 290\fR
\fB 38: bipush 15\fR
\fB 40: invokevirtual #13 // Method\fR
\fBjava/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
\fB 43: return \fR
\fB}\fR
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
java(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
javac(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
javadoc(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jdb(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jdeps(1)
.RE
.br
'pl 8.5i
'bp

View File

@ -0,0 +1,273 @@
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation.
.\"
.\" This code is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code).
.\"
.\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Automatically generated by Pandoc 2.3.1
.\"
.TH "JDEPRSCAN" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
jdeprscan \- static analysis tool that scans a jar file (or some other
aggregation of class files) for uses of deprecated API elements
.SH SYNOPSIS
.PP
\f[CB]jdeprscan\f[R] [\f[I]options\f[R]]
{\f[I]dir\f[R]|\f[I]jar\f[R]|\f[I]class\f[R]}
.TP
.B \f[I]options\f[R]
See \f[B]Options for the jdeprscan Command\f[R]
.RS
.RE
.TP
.B \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
APIs.
The arguments can be a:
.RS
.IP \[bu] 2
\f[I]dir\f[R]: Directory
.IP \[bu] 2
\f[I]jar\f[R]: JAR file
.IP \[bu] 2
\f[I]class\f[R]: Class name or class file
.PP
The class name should use a dot (\f[CB]\&.\f[R]) as a separator.
For example:
.PP
\f[CB]java.lang.Thread\f[R]
.PP
For nested classes, the dollar sign \f[CB]$\f[R] separator character
should be used.
For example:
.PP
\f[CB]java.lang.Thread$State\f[R]
.PP
A class file can also be named.
For example:
.PP
\f[CB]build/classes/java/lang/Thread$State.class\f[R]
.RE
.SH DESCRIPTION
.PP
The \f[CB]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
uses of deprecated API elements.
The deprecated APIs identified by the \f[CB]jdeprscan\f[R] tool are only
those that are defined by Java SE.
Deprecated APIs defined by third\-party libraries aren\[aq]t reported.
.PP
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
the class path.
Set the class path using the \f[CB]\-\-class\-path\f[R] option described
in \f[B]Options for the jdeprscan Command\f[R].
Typically, you would use the same class path as the one that you use
when invoking your application.
.PP
If the \f[CB]jdeprscan\f[R] can\[aq]t find all the dependent classes, it
will generate an error message for each class that\[aq]s missing.
These error messages are typically of the form:
.RS
.PP
\f[CB]error:\ cannot\ find\ class\ ...\f[R]
.RE
.PP
If these errors occur, then you must adjust the class path so that it
includes all dependent classes.
.SH OPTIONS FOR THE JDEPRSCAN COMMAND
.PP
The following options are available:
.TP
.B \f[CB]\-\-class\-path\f[R] \f[I]path\f[R]
Provides a search path for resolution of dependent classes.
.RS
.PP
\f[I]path\f[R] can be a search path that consists of one or more
directories separated by the system\-specific path separator.
For example:
.IP \[bu] 2
\f[B]Oracle Solaris, Linux, and OS X:\f[R]
.RS 2
.RS
.PP
\f[CB]\-\-class\-path\ /some/directory:/another/different/dir\f[R]
.RE
.RE
.PP
\f[B]Note:\f[R]
.PP
On Windows, use a semicolon (\f[CB];\f[R]) as the separator instead of a
colon (\f[CB]:\f[R]).
.IP \[bu] 2
\f[B]Windows:\f[R]
.RS 2
.RS
.PP
\f[CB]\-\-class\-path\ \\some\\directory;\\another\\different\\dir\f[R]
.RE
.RE
.RE
.TP
.B \f[CB]\-\-for\-removal\f[R]
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.
.RS
.RE
.TP
.B \f[CB]\-\-full\-version\f[R]
Prints out the full version string of the tool.
.RS
.RE
.TP
.B \f[CB]\-\-help\f[R] or \f[CB]\-h\f[R]
Prints out a full help message.
.RS
.RE
.TP
.B \f[CB]\-\-list\f[R] or \f[CB]\-l\f[R]
Prints the set of deprecated APIs.
No scanning is done, so no directory, jar, or class arguments should be
provided.
.RS
.RE
.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]
Specifies the Java SE release that provides the set of deprecated APIs
for scanning.
.RS
.RE
.TP
.B \f[CB]\-\-verbose\f[R] or \f[CB]\-v\f[R]
Enables additional message output during processing.
.RS
.RE
.TP
.B \f[CB]\-\-version\f[R]
Prints out the abbreviated version string of the tool.
.RS
.RE
.SH EXAMPLE OF JDEPRSCAN OUTPUT
.PP
The JAR file for this library will be named something similar to
\f[CB]commons\-math3\-3.6.1.jar\f[R].
To scan this JAR file for the use of deprecated APIs, run the following
command:
.RS
.PP
\f[CB]jdeprscan\ commons\-math3\-3.6.1.jar\f[R]
.RE
.PP
This command produces several lines of output.
For example, one line of output might be:
.IP
.nf
\f[CB]
class\ org/apache/commons/math3/util/MathUtils\ uses\ deprecated\ method\ java/lang/Double::<init>(D)V
\f[R]
.fi
.PP
\f[B]Note:\f[R]
.PP
The class name is specified using the slash\-separated binary name as
described in JVMS 4.2.1.
This is the form used internally in class files.
.PP
The deprecated API it uses is a method on the \f[CB]java.lang.Double\f[R]
class.
.PP
The name of the deprecated method is \f[CB]<init>\f[R], which is a special
name that means that the method is actually a constructor.
Another special name is \f[CB]<clinit>\f[R], which indicates a class
static initializer.
.PP
Other methods are listed just by their method name.
Following the method name is the argument list and return type:
.RS
.PP
\f[CB](D)V\f[R]
.RE
.PP
This indicates that it takes just one double value (a primitive) and
returns void.
The argument and return types can become cryptic.
For example, another line of output might be:
.IP
.nf
\f[CB]
class\ org/apache/commons/math3/util/Precision\ uses\ deprecated\ method\ java/math/BigDecimal::setScale(II)Ljava/math/BigDecimal;
\f[R]
.fi
.PP
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].
In this case, the \f[CB](II)\f[R] means that it takes two \f[CB]int\f[R]
arguments.
The \f[CB]Ljava/math/BigDecimal;\f[R] after the parentheses means that it
returns a reference to \f[CB]java.math.BigDecimal\f[R].
.SH JDEPRSCAN ANALYSIS CAN BE VERSION\-SPECIFIC
.PP
You can use \f[CB]jdeprscan\f[R] relative to the previous three JDK
releases.
For example, if you are running JDK 9, then you can check against JDK 8,
7, and 6.
.PP
As an example, look at this code snippet:
.IP
.nf
\f[CB]
public\ class\ Deprecations\ {
\ \ \ SecurityManager\ sm\ =\ new\ RMISecurityManager();\ \ \ \ //\ deprecated\ in\ 8
\ \ \ Boolean\ b2\ =\ new\ Boolean(true);\ \ \ \ \ \ \ \ \ \ //\ deprecated\ in\ 9
}
\f[R]
.fi
.PP
The complete class compiles without warnings in JDK 7.
.PP
If you run \f[CB]jdeprscan\f[R] on a system with JDK 9, then you see:
.IP
.nf
\f[CB]
$\ jdeprscan\ \-\-class\-path\ classes\ \-\-release\ 7\ example.Deprecations
(no\ output)
\f[R]
.fi
.PP
Run \f[CB]jdeprscan\f[R] with a release value of 8:
.IP
.nf
\f[CB]
$\ jdeprscan\ \-\-class\-path\ classes\ \-\-release\ 8\ example.Deprecations
class\ example/Deprecations\ uses\ type\ java/rmi/RMISecurityManager\ deprecated
class\ example/Deprecations\ uses\ method\ in\ type\ java/rmi/RMISecurityManager\ deprecated
\f[R]
.fi
.PP
Run \f[CB]jdeprscan\f[R] on JDK 9:
.IP
.nf
\f[CB]
$\ jdeprscan\ \-\-class\-path\ classes\ example.Deprecations
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\ java/lang/Boolean\ <init>\ (Z)V\ deprecated
\f[R]
.fi

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,518 +19,380 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Basic Tools
.\" Title: jdeps.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jdeps 1 "21 November 2013" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jdeps \- Java class dependency analyzer\&.
.SH SYNOPSIS
.sp
.nf
\fBjdeps\fR [\fIoptions\fR] \fIclasses\fR \&.\&.\&.
.fi
.sp
.TP
\fIoptions\fR
Command-line options\&. See Options\&.
.TP
\fIclasses\fR
Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
.SH DESCRIPTION
The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
.SH OPTIONS
.TH "JDEPS" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
jdeps \- launch the Java class dependency analyzer
.SH SYNOPSIS
.PP
\f[CB]jdeps\f[R] [\f[I]options\f[R]] \f[I]path\f[R] ...
.TP
-dotoutput <\fIdir\fR>
.br
Destination directory for DOT file output\&. If specified, \f3jdeps\fR will generate one dot file per each analyzed archive named <\fIarchive-file-name\fR>\&.dot listing the dependencies, and also a summary file named summary\&.dot listing the dependencies among the archives\&.
.TP
-s, -summary
.br
Prints dependency summary only\&.
.TP
-v, -verbose
.br
Prints all class-level dependencies\&.
.TP
-verbose:package
.br
Prints package-level dependencies excluding dependencies within the same archive\&.
.TP
-verbose:class
.br
Prints class-level dependencies excluding dependencies within the same archive\&.
.TP
-cp <\fIpath\fR>, -classpath <\fIpath\fR>
.br
Specifies where to find class files\&.
See also Setting the Class Path\&.
.TP
-p <\fIpkg name\fR>, -package <\fIpkg name\fR>
.br
Finds dependencies in the specified package\&. You can specify this option multiple times for different packages\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
.TP
-e <\fIregex\fR>, -regex <\fIregex\fR>
.br
Finds dependencies in packages matching the specified regular expression pattern\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
.TP
-include <\fIregex\fR>
.br
Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
.TP
-jdkinternals
.br
Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
.TP
-P, -profile
.br
Shows profile or the file containing a package\&.
.TP
-apionly
.br
Restricts analysis to APIs, for example, dependences from the signature of \f3public\fR and \f3protected\fR members of public classes including field type, method parameter types, returned type, and checked exception types\&.
.TP
-R, -recursive
.br
Recursively traverses all dependencies\&.
.TP
-version
.br
Prints version information\&.
.TP
-h, -?, -help
.br
Prints help message for \f3jdeps\fR\&.
.SH EXAMPLES
Analyzing the dependencies of Notepad\&.jar\&.
.sp
.nf
\f3$ jdeps demo/jfc/Notepad/Notepad\&.jar\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
.fi
.nf
\f3 <unnamed> (Notepad\&.jar)\fP
.fi
.nf
\f3 \-> java\&.awt \fP
.fi
.nf
\f3 \-> java\&.awt\&.event \fP
.fi
.nf
\f3 \-> java\&.beans \fP
.fi
.nf
\f3 \-> java\&.io \fP
.fi
.nf
\f3 \-> java\&.lang \fP
.fi
.nf
\f3 \-> java\&.net \fP
.fi
.nf
\f3 \-> java\&.util \fP
.fi
.nf
\f3 \-> java\&.util\&.logging \fP
.fi
.nf
\f3 \-> javax\&.swing \fP
.fi
.nf
\f3 \-> javax\&.swing\&.border \fP
.fi
.nf
\f3 \-> javax\&.swing\&.event \fP
.fi
.nf
\f3 \-> javax\&.swing\&.text \fP
.fi
.nf
\f3 \-> javax\&.swing\&.tree \fP
.fi
.nf
\f3 \-> javax\&.swing\&.undo \fP
.fi
.nf
\f3\fP
.fi
.sp
Use -P or -profile option to show on which profile that Notepad depends\&.
.sp
.nf
\f3$ jdeps \-profile demo/jfc/Notepad/Notepad\&.jar \fP
.fi
.nf
\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE)\fP
.fi
.nf
\f3 <unnamed> (Notepad\&.jar)\fP
.fi
.nf
\f3 \-> java\&.awt Full JRE\fP
.fi
.nf
\f3 \-> java\&.awt\&.event Full JRE\fP
.fi
.nf
\f3 \-> java\&.beans Full JRE\fP
.fi
.nf
\f3 \-> java\&.io compact1\fP
.fi
.nf
\f3 \-> java\&.lang compact1\fP
.fi
.nf
\f3 \-> java\&.net compact1\fP
.fi
.nf
\f3 \-> java\&.util compact1\fP
.fi
.nf
\f3 \-> java\&.util\&.logging compact1\fP
.fi
.nf
\f3 \-> javax\&.swing Full JRE\fP
.fi
.nf
\f3 \-> javax\&.swing\&.border Full JRE\fP
.fi
.nf
\f3 \-> javax\&.swing\&.event Full JRE\fP
.fi
.nf
\f3 \-> javax\&.swing\&.text Full JRE\fP
.fi
.nf
\f3 \-> javax\&.swing\&.tree Full JRE\fP
.fi
.nf
\f3 \-> javax\&.swing\&.undo Full JRE\fP
.fi
.nf
\f3\fP
.fi
.sp
Analyzing the immediate dependencies of a specific class in a given classpath, for example the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class in the tools\&.jar file\&.
.sp
.nf
\f3$ jdeps \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
.fi
.nf
\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
.fi
.nf
\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
.fi
.nf
\f3 \-> java\&.io \fP
.fi
.nf
\f3 \-> java\&.lang \fP
.fi
.nf
\f3\fP
.fi
.sp
Use the \f3-verbose:class\fR option to find class-level dependencies or use the \f3-v\fR or \f3-verbose\fR option to include dependencies from the same JAR file\&.
.sp
.nf
\f3$ jdeps \-verbose:class \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
.fi
.nf
\f3 com\&.sun\&.tools\&.jdeps\&.Main (tools\&.jar)\fP
.fi
.nf
\f3 \-> java\&.io\&.PrintWriter \fP
.fi
.nf
\f3 \-> java\&.lang\&.Exception \fP
.fi
.nf
\f3 \-> java\&.lang\&.Object \fP
.fi
.nf
\f3 \-> java\&.lang\&.String \fP
.fi
.nf
\f3 \-> java\&.lang\&.System \fP
.fi
.nf
\f3\fP
.fi
.sp
Use the \f3-R\fR or \f3-recursive\fR option to analyze the transitive dependencies of the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class\&.
.sp
.nf
\f3$ jdeps \-R \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
.fi
.nf
\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
.fi
.nf
\f3 com\&.sun\&.tools\&.classfile (tools\&.jar)\fP
.fi
.nf
\f3 \-> java\&.io \fP
.fi
.nf
\f3 \-> java\&.lang \fP
.fi
.nf
\f3 \-> java\&.lang\&.reflect \fP
.fi
.nf
\f3 \-> java\&.nio\&.charset \fP
.fi
.nf
\f3 \-> java\&.nio\&.file \fP
.fi
.nf
\f3 \-> java\&.util \fP
.fi
.nf
\f3 \-> java\&.util\&.regex \fP
.fi
.nf
\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
.fi
.nf
\f3 \-> java\&.io \fP
.fi
.nf
\f3 \-> java\&.lang \fP
.fi
.nf
\f3 \-> java\&.nio\&.file \fP
.fi
.nf
\f3 \-> java\&.nio\&.file\&.attribute \fP
.fi
.nf
\f3 \-> java\&.text \fP
.fi
.nf
\f3 \-> java\&.util \fP
.fi
.nf
\f3 \-> java\&.util\&.jar \fP
.fi
.nf
\f3 \-> java\&.util\&.regex \fP
.fi
.nf
\f3 \-> java\&.util\&.zip \fP
.fi
.nf
\f3/usr/java/jre/lib/jce\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
.fi
.nf
\f3 javax\&.crypto (jce\&.jar)\fP
.fi
.nf
\f3 \-> java\&.io \fP
.fi
.nf
\f3 \-> java\&.lang \fP
.fi
.nf
\f3 \-> java\&.lang\&.reflect \fP
.fi
.nf
\f3 \-> java\&.net \fP
.fi
.nf
\f3 \-> java\&.nio \fP
.fi
.nf
\f3 \-> java\&.security \fP
.fi
.nf
\f3 \-> java\&.security\&.cert \fP
.fi
.nf
\f3 \-> java\&.security\&.spec \fP
.fi
.nf
\f3 \-> java\&.util \fP
.fi
.nf
\f3 \-> java\&.util\&.concurrent \fP
.fi
.nf
\f3 \-> java\&.util\&.jar \fP
.fi
.nf
\f3 \-> java\&.util\&.regex \fP
.fi
.nf
\f3 \-> java\&.util\&.zip \fP
.fi
.nf
\f3 \-> javax\&.security\&.auth \fP
.fi
.nf
\f3 \-> sun\&.security\&.jca JDK internal API (rt\&.jar)\fP
.fi
.nf
\f3 \-> sun\&.security\&.util JDK internal API (rt\&.jar)\fP
.fi
.nf
\f3 javax\&.crypto\&.spec (jce\&.jar)\fP
.fi
.nf
\f3 \-> java\&.lang \fP
.fi
.nf
\f3 \-> java\&.security\&.spec \fP
.fi
.nf
\f3 \-> java\&.util \fP
.fi
.nf
\f3/usr/java/jre/lib/rt\&.jar \-> /usr/java/jre/lib/jce\&.jar\fP
.fi
.nf
\f3 java\&.security (rt\&.jar)\fP
.fi
.nf
\f3 \-> javax\&.crypto\fP
.fi
.nf
\f3\fP
.fi
.sp
Generate dot files of the dependencies of Notepad demo\&.
.sp
.nf
\f3$ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar\fP
.fi
.nf
\f3\fP
.fi
.sp
\f3jdeps\fR will create one dot file for each given JAR file named <\fIfilename\fR>\&.dot in the dot directory specified in the \f3-dotoutput\fR option, and also a summary file named summary\&.dot that will list the dependencies among the JAR files
.sp
.nf
\f3$ cat dot/Notepad\&.jar\&.dot \fP
.fi
.nf
\f3digraph "Notepad\&.jar" {\fP
.fi
.nf
\f3 // Path: demo/jfc/Notepad/Notepad\&.jar\fP
.fi
.nf
\f3 "<unnamed>" \-> "java\&.awt";\fP
.fi
.nf
\f3 "<unnamed>" \-> "java\&.awt\&.event";\fP
.fi
.nf
\f3 "<unnamed>" \-> "java\&.beans";\fP
.fi
.nf
\f3 "<unnamed>" \-> "java\&.io";\fP
.fi
.nf
\f3 "<unnamed>" \-> "java\&.lang";\fP
.fi
.nf
\f3 "<unnamed>" \-> "java\&.net";\fP
.fi
.nf
\f3 "<unnamed>" \-> "java\&.util";\fP
.fi
.nf
\f3 "<unnamed>" \-> "java\&.util\&.logging";\fP
.fi
.nf
\f3 "<unnamed>" \-> "javax\&.swing";\fP
.fi
.nf
\f3 "<unnamed>" \-> "javax\&.swing\&.border";\fP
.fi
.nf
\f3 "<unnamed>" \-> "javax\&.swing\&.event";\fP
.fi
.nf
\f3 "<unnamed>" \-> "javax\&.swing\&.text";\fP
.fi
.nf
\f3 "<unnamed>" \-> "javax\&.swing\&.tree";\fP
.fi
.nf
\f3 "<unnamed>" \-> "javax\&.swing\&.undo";\fP
.fi
.nf
\f3}\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3$ cat dot/summary\&.dot\fP
.fi
.nf
\f3digraph "summary" {\fP
.fi
.nf
\f3 "Notepad\&.jar" \-> "rt\&.jar";\fP
.fi
.nf
\f3}\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH SEE\ ALSO
.TP 0.2i
\(bu
javap(1)
.B \f[I]options\f[R]
Command\-line options.
For detailed descriptions of the options that can be used, see
.RS
.IP \[bu] 2
\f[B]Possible Options\f[R]
.IP \[bu] 2
\f[B]Module Dependence Analysis Options\f[R]
.IP \[bu] 2
\f[B]Options to Filter Dependences\f[R]
.IP \[bu] 2
\f[B]Options to Filter Classes to be Analyzed\f[R]
.RE
.br
'pl 8.5i
'bp
.TP
.B \f[I]path\f[R]
A pathname to the \f[CB]\&.class\f[R] file, directory, or JAR file to
analyze.
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]jdeps\f[R] command shows the package\-level or class\-level
dependencies of Java class files.
The input class can be a path name to a \f[CB]\&.class\f[R] file, a
directory, a JAR file, or it can be a fully qualified class name to
analyze all class files.
The options determine the output.
By default, the \f[CB]jdeps\f[R] command writes the dependencies to the
system output.
The command can generate the dependencies in DOT language (see the
\f[CB]\-dotoutput\f[R] option).
.SH POSSIBLE OPTIONS
.TP
.B \f[CB]\-dotoutput\f[R] \f[I]dir\f[R] or \f[CB]\-\-dot\-output\f[R] \f[I]dir\f[R]
Specifies the destination directory for DOT file output.
If this option is specified, then the \f[CB]jdeps\f[R]command generates
one \f[CB]\&.dot\f[R] file for each analyzed archive named
\f[CB]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
among the archive files.
.RS
.RE
.TP
.B \f[CB]\-s\f[R] or \f[CB]\-summary\f[R]
Prints a dependency summary only.
.RS
.RE
.TP
.B \f[CB]\-v\f[R] or \f[CB]\-verbose\f[R]
Prints all class\-level dependencies.
This is equivalent to
.RS
.RS
.PP
\f[CB]\-verbose:class\ \-filter:none\f[R]
.RE
.RE
.TP
.B \f[CB]\-verbose:package\f[R]
Prints package\-level dependencies excluding, by default, dependences
within the same package.
.RS
.RE
.TP
.B \f[CB]\-verbose:class\f[R]
Prints class\-level dependencies excluding, by default, dependencies
within the same archive.
.RS
.RE
.TP
.B \f[CB]\-apionly\f[R] or \f[CB]\-\-api\-only\f[R]
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
classes including field type, method parameter types, returned type, and
checked exception types.
.RS
.RE
.TP
.B \f[CB]\-jdkinternals\f[R] or \f[CB]\-\-jdk\-internals\f[R]
Finds class\-level dependences in the JDK internal APIs.
By default, this option analyzes all classes specified in the
\f[CB]\-\-classpath\f[R] option and input files unless you specified the
\f[CB]\-include\f[R] option.
You can\[aq]t use this option with the \f[CB]\-p\f[R], \f[CB]\-e\f[R], and
\f[CB]\-s\f[R] options.
.RS
.PP
\f[B]Warning\f[R]: The JDK internal APIs are inaccessible.
.RE
.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]
Specifies where to find class files.
.RS
.RE
.TP
.B \f[CB]\-\-module\-path\f[R] \f[I]module\-path\f[R]
Specifies the module path.
.RS
.RE
.TP
.B \f[CB]\-\-upgrade\-module\-path\f[R] \f[I]module\-path\f[R]
Specifies the upgrade module path.
.RS
.RE
.TP
.B \f[CB]\-\-system\f[R] \f[I]java\-home\f[R]
Specifies an alternate system module path.
.RS
.RE
.TP
.B \f[CB]\-\-add\-modules\f[R] \f[I]module\-name\f[R][\f[CB],\f[R] \f[I]module\-name\f[R]...]
Adds modules to the root set for analysis.
.RS
.RE
.TP
.B \f[CB]\-\-multi\-release\f[R] \f[I]version\f[R]
Specifies the version when processing multi\-release JAR files.
\f[I]version\f[R] should be an integer >=9 or base.
.RS
.RE
.TP
.B \f[CB]\-q\f[R] or \f[CB]\-quiet\f[R]
Doesn\[aq]t show missing dependencies from
\f[CB]\-generate\-module\-info\f[R] output.
.RS
.RE
.TP
.B \f[CB]\-version\f[R] or \f[CB]\-\-version\f[R]
Prints version information.
.RS
.RE
.SH MODULE DEPENDENCE ANALYSIS OPTIONS
.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]
Specifies the root module for analysis.
.RS
.RE
.TP
.B \f[CB]\-\-generate\-module\-info\f[R] \f[I]dir\f[R]
Generates \f[CB]module\-info.java\f[R] under the specified directory.
The specified JAR files will be analyzed.
This option cannot be used with \f[CB]\-\-dot\-output\f[R] or
\f[CB]\-\-class\-path\f[R] options.
Use the \f[CB]\-\-generate\-open\-module\f[R] option for open modules.
.RS
.RE
.TP
.B \f[CB]\-\-generate\-open\-module\f[R] \f[I]dir\f[R]
Generates \f[CB]module\-info.java\f[R] for the specified JAR files under
the specified directory as open modules.
This option cannot be used with the \f[CB]\-\-dot\-output\f[R] or
\f[CB]\-\-class\-path\f[R] options.
.RS
.RE
.TP
.B \f[CB]\-\-check\f[R] \f[I]module\-name\f[R] [\f[CB],\f[R] \f[I]module\-name\f[R]...]
Analyzes the dependence of the specified modules.
It prints the module descriptor, the resulting module dependences after
analysis and the graph after transition reduction.
It also identifies any unused qualified exports.
.RS
.RE
.TP
.B \f[CB]\-\-list\-deps\f[R]
Lists the module dependences and also the package names of JDK internal
APIs (if referenced).
This option transitively analyzes libraries on class path and module
path if referenced.
Use \f[CB]\-\-no\-recursive\f[R] option for non\-transitive dependency
analysis.
.RS
.RE
.TP
.B \f[CB]\-\-list\-reduced\-deps\f[R]
Same as \f[CB]\-\-list\-deps\f[R] without listing the implied reads edges
from the module graph.
If module M1 reads M2, and M2 requires transitive on M3, then M1 reading
M3 is implied and is not shown in the graph.
.RS
.RE
.TP
.B \f[CB]\-\-print\-module\-deps\f[R]
Same as \f[CB]\-\-list\-reduced\-deps\f[R] with printing a
comma\-separated list of module dependences.
The output can be used by \f[CB]jlink\ \-\-add\-modules\f[R] to create a
custom image that contains those modules and their transitive
dependences.
.RS
.RE
.TP
.B \f[CB]\-\-ignore\-missing\-deps\f[R]
Ignore missing dependences.
.RS
.RE
.SH OPTIONS TO FILTER DEPENDENCES
.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]
Finds dependences matching the specified package name.
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.
.RS
.RE
.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]
Finds dependences matching the specified pattern.
The \f[CB]\-p\f[R] and \f[CB]\-e\f[R] options are mutually exclusive.
.RS
.RE
.TP
.B \f[CB]\-\-require\f[R] \f[I]module\-name\f[R]
Finds dependences matching the given module name (may be given multiple
times).
The \f[CB]\-\-package\f[R], \f[CB]\-\-regex\f[R], and \f[CB]\-\-require\f[R]
options are mutually exclusive.
.RS
.RE
.TP
.B \f[CB]\-f\f[R] \f[I]regex\f[R] or \f[CB]\-filter\f[R] \f[I]regex\f[R]
Filters dependences matching the given pattern.
If give multiple times, the last one will be selected.
.RS
.RE
.TP
.B \f[CB]\-filter:package\f[R]
Filters dependences within the same package.
This is the default.
.RS
.RE
.TP
.B \f[CB]\-filter:archive\f[R]
Filters dependences within the same archive.
.RS
.RE
.TP
.B \f[CB]\-filter:module\f[R]
Filters dependences within the same module.
.RS
.RE
.TP
.B \f[CB]\-filter:none\f[R]
No \f[CB]\-filter:package\f[R] and \f[CB]\-filter:archive\f[R] filtering.
Filtering specified via the \f[CB]\-filter\f[R] option still applies.
.RS
.RE
.TP
.B \f[CB]\-\-missing\-deps\f[R]
Finds missing dependences.
This option cannot be used with \f[CB]\-p\f[R], \f[CB]\-e\f[R] and
\f[CB]\-s\f[R] options.
.RS
.RE
.SH OPTIONS TO FILTER CLASSES TO BE ANALYZED
.TP
.B \f[CB]\-include\f[R] \f[I]regex\f[R]
Restricts analysis to the classes matching pattern.
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
the pattern to the dependencies.
.RS
.RE
.TP
.B \f[CB]\-P\f[R] or \f[CB]\-profile\f[R]
Shows the profile containing a package.
.RS
.RE
.TP
.B \f[CB]\-R\f[R] or \f[CB]\-recursive\f[R]
Recursively traverses all run\-time dependences.
The \f[CB]\-R\f[R] option implies \f[CB]\-filter:none\f[R].
If \f[CB]\-p\f[R], \f[CB]\-e\f[R], or \f[CB]\-f\f[R] options are specified,
only the matching dependences are analyzed.
.RS
.RE
.TP
.B \f[CB]\-\-no\-recursive\f[R]
Do not recursively traverse dependences.
.RS
.RE
.TP
.B \f[CB]\-I\f[R] or \f[CB]\-inverse\f[R]
Analyzes the dependences per other given options and then finds all
artifacts that directly and indirectly depend on the matching nodes.
This is equivalent to the inverse of the compile\-time view analysis and
the print dependency summary.
This option must be used with the \f[CB]\-\-require\f[R],
\f[CB]\-\-package\f[R], or \f[CB]\-\-regex\f[R] options.
.RS
.RE
.TP
.B \f[CB]\-\-compile\-time\f[R]
Analyzes the compile\-time view of transitive dependencies, such as the
compile\-time view of the \f[CB]\-R\f[R] option.
Analyzes the dependences per other specified options.
If a dependency is found from a directory, a JAR file or a module, all
classes in that containing archive are analyzed.
.RS
.RE
.SH EXAMPLE OF ANALYZING DEPENDENCIES
.PP
The following example demonstrates analyzing the dependencies of the
\f[CB]Notepad.jar\f[R] file.
.PP
\f[B]Oracle Solaris, Linux, and OS X:\f[R]
.IP
.nf
\f[CB]
$\ jdeps\ demo/jfc/Notepad/Notepad.jar
Notepad.jar\ \->\ java.base
Notepad.jar\ \->\ java.desktop
Notepad.jar\ \->\ java.logging
\ \ \ <unnamed>\ (Notepad.jar)
\ \ \ \ \ \ \->\ java.awt
\ \ \ \ \ \ \->\ java.awt.event
\ \ \ \ \ \ \->\ java.beans
\ \ \ \ \ \ \->\ java.io
\ \ \ \ \ \ \->\ java.lang
\ \ \ \ \ \ \->\ java.net
\ \ \ \ \ \ \->\ java.util
\ \ \ \ \ \ \->\ java.util.logging
\ \ \ \ \ \ \->\ javax.swing
\ \ \ \ \ \ \->\ javax.swing.border
\ \ \ \ \ \ \->\ javax.swing.event
\ \ \ \ \ \ \->\ javax.swing.text
\ \ \ \ \ \ \->\ javax.swing.tree
\ \ \ \ \ \ \->\ javax.swing.undo
\f[R]
.fi
.PP
\f[B]Windows:\f[R]
.IP
.nf
\f[CB]
C:\\Java\\jdk1.9.0>jdeps\ demo\\jfc\\Notepad\\Notepad.jar
Notepad.jar\ \->\ java.base
Notepad.jar\ \->\ java.desktop
Notepad.jar\ \->\ java.logging
\ \ \ <unnamed>\ (Notepad.jar)
\ \ \ \ \ \ \->\ java.awt
\ \ \ \ \ \ \->\ java.awt.event
\ \ \ \ \ \ \->\ java.beans
\ \ \ \ \ \ \->\ java.io
\ \ \ \ \ \ \->\ java.lang
\ \ \ \ \ \ \->\ java.net
\ \ \ \ \ \ \->\ java.util
\ \ \ \ \ \ \->\ java.util.logging
\ \ \ \ \ \ \->\ javax.swing
\ \ \ \ \ \ \->\ javax.swing.border
\ \ \ \ \ \ \->\ javax.swing.event
\ \ \ \ \ \ \->\ javax.swing.text
\ \ \ \ \ \ \->\ javax.swing.tree
\ \ \ \ \ \ \->\ javax.swing.undo
\f[R]
.fi
.SH EXAMPLE USING THE \-\-INVERSE OPTION
.IP
.nf
\f[CB]
\ $\ jdeps\ \-\-inverse\ \-\-require\ java.xml.bind
Inverse\ transitive\ dependences\ on\ [java.xml.bind]
java.xml.bind\ <\-\ java.se.ee
java.xml.bind\ <\-\ jdk.xml.ws
java.xml.bind\ <\-\ java.xml.ws\ <\-\ java.se.ee
java.xml.bind\ <\-\ java.xml.ws\ <\-\ jdk.xml.ws
java.xml.bind\ <\-\ jdk.xml.bind\ <\-\ jdk.xml.ws
\f[R]
.fi

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,248 +19,245 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Basic Tools
.\" Title: jdb.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jdb 1 "21 November 2013" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jdb \- Finds and fixes bugs in Java platform programs\&.
.SH SYNOPSIS
.sp
.nf
\fBjdb\fR [\fIoptions\fR] [\fIclassname\fR] [\fIarguments\fR]
.fi
.sp
.TP
\fIoptions\fR
Command-line options\&. See Options\&.
.TP
\fIclass\fRname
Name of the main class to debug\&.
.TP
\fIarguments\fR
Arguments passed to the \f3main()\fR method of the class\&.
.SH DESCRIPTION
The Java Debugger (JDB) is a simple command-line debugger for Java classes\&. The \f3jdb\fR command and its options call the JDB\&. The \f3jdb\fR command demonstrates the Java Platform Debugger Architecture (JDBA) and provides inspection and debugging of a local or remote Java Virtual Machine (JVM)\&. See Java Platform Debugger Architecture (JDBA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
.SS START\ A\ JDB\ SESSION
There are many ways to start a JDB session\&. The most frequently used way is to have JDB launch a new JVM with the main class of the application to be debugged\&. Do this by substituting the \f3jdb\fR command for the \f3java\fR command in the command line\&. For example, if your application\&'s main class is \f3MyClass\fR, then use the following command to debug it under JDB:
.sp
.nf
\f3jdb MyClass\fP
.fi
.nf
\f3\fP
.fi
.sp
When started this way, the \f3jdb\fR command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class\&'s first instruction\&.
.TH "JDB" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
Another way to use the \f3jdb\fR command is by attaching it to a JVM that is already running\&. Syntax for starting a JVM to which the \f3jdb\fR command attaches when the JVM is running is as follows\&. This loads in-process debugging libraries and specifies the kind of connection to be made\&.
.sp
.nf
\f3java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\fP
.fi
.nf
\f3\fP
.fi
.sp
You can then attach the \f3jdb\fR command to the JVM with the following command:
.sp
.nf
\f3jdb \-attach 8000\fP
.fi
.nf
\f3\fP
.fi
.sp
The \f3MyClass\fR argument is not specified in the \f3jdb\fR command line in this case because the \f3jdb\fR command is connecting to an existing JVM instead of launching a new JVM\&.
jdb \- find and fix bugs in Java platform programs
.SH SYNOPSIS
.PP
There are many other ways to connect the debugger to a JVM, and all of them are supported by the \f3jdb\fR command\&. The Java Platform Debugger Architecture has additional documentation on these connection options\&.
.SS BASIC\ JDB\ COMMANDS
The following is a list of the basic \f3jdb\fR commands\&. The JDB supports other commands that you can list with the \f3-help\fR option\&.
.TP
help or ?
The \f3help\fR or \f3?\fR commands display the list of recognized commands with a brief description\&.
.TP
run
After you start JDB and set breakpoints, you can use the \f3run\fR command to execute the debugged application\&. The \f3run\fR command is available only when the \f3jdb\fR command starts the debugged application as opposed to attaching to an existing JVM\&.
.TP
cont
Continues execution of the debugged application after a breakpoint, exception, or step\&.
.TP
print
Displays Java objects and primitive values\&. For variables or fields of primitive types, the actual value is printed\&. For objects, a short description is printed\&. See the dump command to find out how to get more information about an object\&.
\fINote:\fR To display local variables, the containing class must have been compiled with the \f3javac -g\fR option\&.
The \f3print\fR command supports many simple Java expressions including those with method invocations, for example:
.sp
.nf
\f3print MyClass\&.myStaticField\fP
.fi
.nf
\f3print myObj\&.myInstanceField\fP
.fi
.nf
\f3print i + j + k (i, j, k are primities and either fields or local variables)\fP
.fi
.nf
\f3print myObj\&.myMethod() (if myMethod returns a non\-null)\fP
.fi
.nf
\f3print new java\&.lang\&.String("Hello")\&.length()\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
dump
For primitive values, the \f3dump\fR command is identical to the \f3print\fR command\&. For objects, the \f3dump\fR command prints the current value of each field defined in the object\&. Static and instance fields are included\&. The \f3dump\fR command supports the same set of expressions as the \f3print\fR command\&.
.TP
threads
List the threads that are currently running\&. For each thread, its name and current status are printed and an index that can be used in other commands\&. In this example, the thread index is 4, the thread is an instance of \f3java\&.lang\&.Thread\fR, the thread name is \f3main\fR, and it is currently running\&.
.sp
.nf
\f34\&. (java\&.lang\&.Thread)0x1 main running\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
thread
Select a thread to be the current thread\&. Many \f3jdb\fR commands are based on the setting of the current thread\&. The thread is specified with the thread index described in the threads command\&.
.TP
where
The \f3where\fR command with no arguments dumps the stack of the current thread\&. The \f3where\fR\f3all\fR command dumps the stack of all threads in the current thread group\&. The \f3where\fR\f3threadindex\fR command dumps the stack of the specified thread\&.
If the current thread is suspended either through an event such as a breakpoint or through the \f3suspend\fR command, then local variables and fields can be displayed with the \f3print\fR and \f3dump\fR commands\&. The \f3up\fR and \f3down\fR commands select which stack frame is the current stack frame\&.
.SS BREAKPOINTS
Breakpoints can be set in JDB at line numbers or at the first instruction of a method, for example:
.TP 0.2i
\(bu
The command \f3stop at MyClass:22\fR sets a breakpoint at the first instruction for line 22 of the source file containing \f3MyClass\fR\&.
.TP 0.2i
\(bu
The command \f3stop in java\&.lang\&.String\&.length\fR sets a breakpoint at the beginning of the method \f3java\&.lang\&.String\&.length\fR\&.
.TP 0.2i
\(bu
The command \f3stop in MyClass\&.<clinit>\fR uses \f3<clinit>\fR to identify the static initialization code for \f3MyClass\fR\&.
.PP
When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint\&. For example, \f3MyClass\&.myMethod(int,java\&.lang\&.String)\fR or \f3MyClass\&.myMethod()\fR\&.
.PP
The \f3clear\fR command removes breakpoints using the following syntax: \f3clear MyClass:45\fR\&. Using the \f3clear\fR or \f3stop\fR command with no argument displays a list of all breakpoints currently set\&. The \f3cont\fR command continues execution\&.
.SS STEPPING
The \f3step\fR command advances execution to the next line whether it is in the current stack frame or a called method\&. The \f3next\fR command advances execution to the next line in the current stack frame\&.
.SS EXCEPTIONS
When an exception occurs for which there is not a \f3catch\fR statement anywhere in the throwing thread\&'s call stack, the JVM typically prints an exception trace and exits\&. When running under JDB, however, control returns to JDB at the offending throw\&. You can then use the \f3jdb\fR command to diagnose the cause of the exception\&.
.PP
Use the \f3catch\fR command to cause the debugged application to stop at other thrown exceptions, for example: \f3catch java\&.io\&.FileNotFoundException\fR or \f3catch\fR\f3mypackage\&.BigTroubleException\fR\&. Any exception that is an instance of the specified class or subclass stops the application at the point where it is thrown\&.
.PP
The \f3ignore\fR command negates the effect of an earlier \f3catch\fR command\&. The \f3ignore\fR command does not cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger\&.
.SH OPTIONS
When you use the \f3jdb\fR command instead of the \f3java\fR command on the command line, the \f3jdb\fR command accepts many of the same options as the \f3java\fR command, including \f3-D\fR, \f3-classpath\fR, and \f3-X\fR options\&. The following list contains additional options that are accepted by the \f3jdb\fR command\&.
.PP
Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM it is to debug\&. For additional documentation about these connection alternatives, see Java Platform Debugger Architecture (JPDA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
\f[CB]jdb\f[R] [\f[I]options\f[R]] [\f[I]classname\f[R]]
[\f[I]arguments\f[R]]
.TP
-help
.br
Displays a help message\&.
.TP
-sourcepath \fIdir1:dir2: \&. \&. \&.\fR
.br
Uses the specified path to search for source files in the specified path\&. If this option is not specified, then use the default path of dot (\&.)\&.
.TP
-attach \fIaddress\fR
.br
Attaches the debugger to a running JVM with the default connection mechanism\&.
.TP
-listen \fIaddress\fR
.br
Waits for a running JVM to connect to the specified address with a standard connector\&.
.TP
-launch
.br
Starts the debugged application immediately upon startup of JDB\&. The \f3-launch\fR option removes the need for the \f3run\fR command\&. The debugged application is launched and then stopped just before the initial application class is loaded\&. At that point, you can set any necessary breakpoints and use the \f3cont\fR command to continue execution\&.
.TP
-listconnectors
.br
List the connectors available in this JVM\&.
.TP
-connect connector-name:\fIname1=value1\fR
.br
Connects to the target JVM with the named connector and listed argument values\&.
.TP
-dbgtrace [\fIflags\fR]
.br
Prints information for debugging the \f3jdb\fR command\&.
.TP
-tclient
.br
Runs the application in the Java HotSpot VM client\&.
.TP
-tserver
.br
Runs the application in the Java HotSpot VM server\&.
.TP
-J\fIoption\fR
.br
Passes \f3option\fR to the JVM, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.SH OPTIONS\ FORWARDED\ TO\ THE\ DEBUGGER\ PROCESS
.TP
-v -verbose[:\fIclass\fR|gc|jni]
.br
Turns on verbose mode\&.
.TP
-D\fIname\fR=\fIvalue\fR
.br
Sets a system property\&.
.TP
-classpath \fIdir\fR
.br
Lists directories separated by colons in which to look for classes\&.
.TP
-X\fIoption\fR
.br
Nonstandard target JVM option\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
javac(1)
.TP 0.2i
\(bu
java(1)
.TP 0.2i
\(bu
javap(1)
.B \f[I]options\f[R]
This represents the \f[CB]jdb\f[R] command\-line options.
See \f[B]Options for the jdb command\f[R].
.RS
.RE
.br
'pl 8.5i
'bp
.TP
.B \f[I]classname\f[R]
This represents the name of the main class to debug.
.RS
.RE
.TP
.B \f[I]arguments\f[R]
This represents the arguments that are passed to the \f[CB]main()\f[R]
method of the class.
.RS
.RE
.SH DESCRIPTION
.PP
The Java Debugger (JDB) is a simple command\-line debugger for Java
classes.
The \f[CB]jdb\f[R] command and its options call the JDB.
The \f[CB]jdb\f[R] command demonstrates the Java Platform Debugger
Architecture and provides inspection and debugging of a local or remote
JVM.
.SH START A JDB SESSION
.PP
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 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]
command in the command line.
For example, if your application\[aq]s main class is \f[CB]MyClass\f[R],
then use the following command to debug it under the JDB:
.RS
.PP
\f[CB]jdb\ MyClass\f[R]
.RE
.PP
When started this way, the \f[CB]jdb\f[R] command calls a second JVM with
the specified parameters, loads the specified class, and stops the JVM
before executing that class\[aq]s first instruction.
.PP
Another way to use the \f[CB]jdb\f[R] command is by attaching it to a JVM
that\[aq]s already running.
Syntax for starting a JVM to which the \f[CB]jdb\f[R] command attaches
when the JVM is running is as follows.
This loads in\-process debugging libraries and specifies the kind of
connection to be made.
.RS
.PP
\f[CB]java\ \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n\ MyClass\f[R]
.RE
.PP
You can then attach the \f[CB]jdb\f[R] command to the JVM with the
following command:
.RS
.PP
\f[CB]jdb\ \-attach\ 8000\f[R]
.RE
.PP
8000 is the address of the running JVM.
.PP
The \f[CB]MyClass\f[R] argument isn\[aq]t specified in the \f[CB]jdb\f[R]
command line in this case because the \f[CB]jdb\f[R] command is connecting
to an existing JVM instead of launching a new JVM.
.PP
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.
The Java Platform Debugger Architecture has additional documentation on
these connection options.
.SH BREAKPOINTS
.PP
Breakpoints can be set in the JDB at line numbers or at the first
instruction of a method, for example:
.IP \[bu] 2
The command \f[CB]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].
.IP \[bu] 2
The command \f[CB]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].
.IP \[bu] 2
The command \f[CB]stop\ in\ MyClass.<clinit>\f[R] uses \f[CB]<clinit>\f[R]
to identify the static initialization code for \f[CB]MyClass\f[R].
.PP
When a method is overloaded, you must also specify its argument types so
that the proper method can be selected for a breakpoint.
For example, \f[CB]MyClass.myMethod(int,java.lang.String)\f[R] or
\f[CB]MyClass.myMethod()\f[R].
.PP
The \f[CB]clear\f[R] command removes breakpoints using the following
syntax: \f[CB]clear\ MyClass:45\f[R].
Using the \f[CB]clear\f[R] or \f[CB]stop\f[R] command with no argument
displays a list of all breakpoints currently set.
The \f[CB]cont\f[R] command continues execution.
.SH STEPPING
.PP
The \f[CB]step\f[R] command advances execution to the next line whether
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
current stack frame.
.SH EXCEPTIONS
.PP
When an exception occurs for which there isn\[aq]t a \f[CB]catch\f[R]
statement anywhere in the throwing thread\[aq]s call stack, the JVM
typically prints an exception trace and exits.
When running under the JDB, however, control returns to the JDB at the
offending throw.
You can then use the \f[CB]jdb\f[R] command to diagnose the cause of the
exception.
.PP
Use the \f[CB]catch\f[R] command to cause the debugged application to stop
at other thrown exceptions, for example:
\f[CB]catch\ java.io.FileNotFoundException\f[R] or \f[CB]catch\f[R]
\f[CB]mypackage.BigTroubleException\f[R].
Any exception that\[aq]s an instance of the specified class or subclass
stops the application at the point where the exception is thrown.
.PP
The \f[CB]ignore\f[R] command negates the effect of an earlier
\f[CB]catch\f[R] command.
The \f[CB]ignore\f[R] command doesn\[aq]t cause the debugged JVM to ignore
specific exceptions, but only to ignore the debugger.
.SH OPTIONS FOR THE JDB COMMAND
.PP
When you use the \f[CB]jdb\f[R] command instead of the \f[CB]java\f[R]
command on the command line, the \f[CB]jdb\f[R] command accepts many of
the same options as the \f[CB]java\f[R] command.
.PP
The following options are accepted by the \f[CB]jdb\f[R] command:
.TP
.B \f[CB]\-help\f[R]
Displays a help message.
.RS
.RE
.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]...
Uses the specified path to search for source files in the specified
path.
If this option is not specified, then use the default path of dot
(\f[CB]\&.\f[R]).
.RS
.RE
.TP
.B \f[CB]\-attach\f[R] \f[I]address\f[R]
Attaches the debugger to a running JVM with the default connection
mechanism.
.RS
.RE
.TP
.B \f[CB]\-listen\f[R] \f[I]address\f[R]
Waits for a running JVM to connect to the specified address with a
standard connector.
.RS
.RE
.TP
.B \f[CB]\-listenany\f[R]
Waits for a running JVM to connect at any available address using a
standard connector.
.RS
.RE
.TP
.B \f[CB]\-launch\f[R]
Starts the debugged application immediately upon startup of the
\f[CB]jdb\f[R] command.
The \f[CB]\-launch\f[R] option removes the need for the \f[CB]run\f[R]
command.
The debugged application is launched and then stopped just before the
initial application class is loaded.
At that point, you can set any necessary breakpoints and use the
\f[CB]cont\f[R] command to continue execution.
.RS
.RE
.TP
.B \f[CB]\-listconnectors\f[R]
Lists the connectors available in this JVM.
.RS
.RE
.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]....
Connects to the target JVM with the named connector and listed argument
values.
.RS
.RE
.TP
.B \f[CB]\-dbgtrace\f[R] [\f[I]flags\f[R]]
Prints information for debugging the \f[CB]jdb\f[R] command.
.RS
.RE
.TP
.B \f[CB]\-tclient\f[R]
Runs the application in the Java HotSpot VM client.
.RS
.RE
.TP
.B \f[CB]\-tserver\f[R]
Runs the application in the Java HotSpot VM server.
.RS
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]option\f[R]
Passes \f[I]option\f[R] to the JVM, where option is one of the options
described on the reference page for the Java application launcher.
For example, \f[CB]\-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].
.RS
.RE
.PP
The following options are forwarded to the debuggee process:
.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]]
Turns on the verbose mode.
.RS
.RE
.TP
.B \f[CB]\-D\f[R]\f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R]
Sets a system property.
.RS
.RE
.TP
.B \f[CB]\-classpath\f[R] \f[I]dir\f[R]
Lists directories separated by colons in which to look for classes.
.RS
.RE
.TP
.B \f[CB]\-X\f[R] \f[I]option\f[R]
A nonstandard target JVM option.
.RS
.RE
.PP
Other options are supported to provide alternate mechanisms for
connecting the debugger to the JVM that it\[aq]s to debug.

View File

@ -0,0 +1,436 @@
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation.
.\"
.\" This code is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code).
.\"
.\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Automatically generated by Pandoc 2.3.1
.\"
.TH "JLINK" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
jlink \- assemble and optimize a set of modules and their dependencies
into a custom runtime image
.SH SYNOPSIS
.PP
\f[CB]jlink\f[R] [\f[I]options\f[R]] \f[CB]\-\-module\-path\f[R]
\f[I]modulepath\f[R] \f[CB]\-\-add\-modules\f[R] \f[I]module\f[R] [,
\f[I]module\f[R]...]
.TP
.B \f[I]options\f[R]
Command\-line options separated by spaces.
See \f[B]jlink Options\f[R].
.RS
.RE
.TP
.B \f[I]modulepath\f[R]
The path where the \f[CB]jlink\f[R] tool discovers observable modules.
These modules can be modular JAR files, JMOD files, or exploded modules.
.RS
.RE
.TP
.B \f[I]module\f[R]
The names of the modules to add to the runtime image.
The \f[CB]jlink\f[R] tool adds these modules and their transitive
dependencies.
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]jlink\f[R] tool links a set of modules, along with their
transitive dependences, to create a custom runtime image.
.PP
\f[B]Note:\f[R]
.PP
Developers are responsible for updating their custom runtime images.
.SH JLINK OPTIONS
.TP
.B \f[CB]\-\-add\-modules\f[R] \f[I]mod\f[R] [\f[CB],\f[R] \f[I]mod\f[R]...]
Adds the named modules, \f[I]mod\f[R], to the default set of root
modules.
The default set of root modules is empty.
.RS
.RE
.TP
.B \f[CB]\-\-bind\-services\f[R]
Link service provider modules and their dependencies.
.RS
.RE
.TP
.B \f[CB]\-c\ ={0|1|2}\f[R] or \f[CB]\-\-compress={0|1|2}\f[R]
Enable compression of resources:
.RS
.IP \[bu] 2
\f[CB]0\f[R]: No compression
.IP \[bu] 2
\f[CB]1\f[R]: Constant string sharing
.IP \[bu] 2
\f[CB]2\f[R]: ZIP
.RE
.TP
.B \f[CB]\-\-disable\-plugin\f[R] \f[I]pluginname\f[R]
Disables the specified plug\-in.
See \f[B]jlink Plug\-ins\f[R] for the list of supported plug\-ins.
.RS
.RE
.TP
.B \f[CB]\-\-endian\f[R] {\f[CB]little\f[R]|\f[CB]big\f[R]}
Specifies the byte order of the generated image.
The default value is the format of your system\[aq]s architecture.
.RS
.RE
.TP
.B \f[CB]\-h\f[R] or \f[CB]\-\-help\f[R]
Prints the help message.
.RS
.RE
.TP
.B \f[CB]\-\-ignore\-signing\-information\f[R]
Suppresses a fatal error when signed modular JARs are linked in the
runtime image.
The signature\-related files of the signed modular JARs aren\[aq]t
copied to the runtime image.
.RS
.RE
.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]
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
separated by a slash (\f[CB]/\f[R])).
.RS
.RE
.TP
.B \f[CB]\-\-limit\-modules\f[R] \f[I]mod\f[R] [\f[CB],\f[R] \f[I]mod\f[R]...]
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
any, plus any further modules specified in the \f[CB]\-\-add\-modules\f[R]
option.
.RS
.RE
.TP
.B \f[CB]\-\-list\-plugins\f[R]
Lists available plug\-ins, which you can access through command\-line
options; see \f[B]jlink Plug\-ins\f[R].
.RS
.RE
.TP
.B \f[CB]\-p\f[R] or \f[CB]\-\-module\-path\f[R] \f[I]modulepath\f[R]
Specifies the module path.
.RS
.PP
If this option is not specified, then the default module path is
\f[CB]$JAVA_HOME/jmods\f[R].
This directory contains the \f[CB]java.base\f[R] module and the other
standard and JDK modules.
If this option is specified but the \f[CB]java.base\f[R] module cannot be
resolved from it, then the \f[CB]jlink\f[R] command appends
\f[CB]$JAVA_HOME/jmods\f[R] to the module path.
.RE
.TP
.B \f[CB]\-\-no\-header\-files\f[R]
Excludes header files.
.RS
.RE
.TP
.B \f[CB]\-\-no\-man\-pages\f[R]
Excludes man pages.
.RS
.RE
.TP
.B \f[CB]\-\-output\f[R] \f[I]path\f[R]
Specifies the location of the generated runtime image.
.RS
.RE
.TP
.B \f[CB]\-\-save\-opts\f[R] \f[I]filename\f[R]
Saves \f[CB]jlink\f[R] options in the specified file.
.RS
.RE
.TP
.B \f[CB]\-\-suggest\-providers\f[R] [\f[I]name\f[R]\f[CB],\f[R] ...]
Suggest providers that implement the given service types from the module
path.
.RS
.RE
.TP
.B \f[CB]\-\-version\f[R]
Prints version information.
.RS
.RE
.TP
.B \f[CB]\@\f[R]\f[I]filename\f[R]
Reads options from the specified file.
.RS
.PP
An options file is a text file that contains the options and values that
you would typically enter in a command prompt.
Options may appear on one line or on several lines.
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
beginning of the line.
.PP
The following is an example of an options file for the \f[CB]jlink\f[R]
command:
.IP
.nf
\f[CB]
#Wed\ Dec\ 07\ 00:40:19\ EST\ 2016
\-\-module\-path\ mlib
\-\-add\-modules\ com.greetings
\-\-output\ greetingsapp
\f[R]
.fi
.RE
.SH JLINK PLUG\-INS
.PP
\f[B]Note:\f[R]
.PP
Plug\-ins not listed in this section aren\[aq]t supported and are
subject to change.
.PP
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
following forms:
.IP \[bu] 2
\f[I]glob\-pattern\f[R]
.IP \[bu] 2
\f[CB]glob:\f[R]\f[I]glob\-pattern\f[R]
.IP \[bu] 2
\f[CB]regex:\f[R]\f[I]regex\-pattern\f[R]
.IP \[bu] 2
\f[CB]\@\f[R]\f[I]filename\f[R]
.RS 2
.IP \[bu] 2
\f[I]filename\f[R] is the name of a file that contains patterns to be
used, one pattern per line.
.RE
.PP
For a complete list of all available plug\-ins, run the command
\f[CB]jlink\ \-\-list\-plugins\f[R].
.SS Plugin \f[CB]compress\f[R]
.TP
.B 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]]
.RS
.RE
.TP
.B Description
Compresses all resources in the output image.
.RS
.IP \[bu] 2
Level 0: No compression
.IP \[bu] 2
Level 1: Constant string sharing
.IP \[bu] 2
Level 2: ZIP
.PP
An optional \f[I]pattern\-list\f[R] filter can be specified to list the
pattern of files to include.
.RE
.SS Plugin \f[CB]include\-locales\f[R]
.TP
.B Options
\f[CB]\-\-include\-locales=\f[R]\f[I]langtag\f[R][\f[CB],\f[R]\f[I]langtag\f[R]]*
.RS
.RE
.TP
.B Description
Includes the list of locales where \f[I]langtag\f[R] is a BCP 47 language
tag.
This option supports locale matching as defined in RFC 4647.
Ensure that you add the module jdk.localedata when using this option.
.RS
.PP
Example:
.RS
.PP
\f[CB]\-\-add\-modules\ jdk.localedata\ \-\-include\-locales=en,ja,*\-IN\f[R]
.RE
.RE
.SS Plugin \f[CB]order\-resources\f[R]
.TP
.B Options
\f[CB]\-\-order\-resources=\f[R]\f[I]pattern\-list\f[R]
.RS
.RE
.TP
.B Description
Orders the specified paths in priority order.
If \f[CB]\@\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
ordered.
.RS
.PP
Example:
.RS
.PP
\f[CB]\-\-order\-resources=/module\-info.class,\@classlist,/java.base/java/lang/\f[R]
.RE
.RE
.SS Plugin \f[CB]strip\-debug\f[R]
.TP
.B Options
\f[CB]\-\-strip\-debug\f[R]
.RS
.RE
.TP
.B Description
Strips debug information from the output image.
.RS
.RE
.SH JLINK EXAMPLES
.PP
The following command creates a runtime image in the directory
\f[CB]greetingsapp\f[R].
This command links the module \f[CB]com.greetings\f[R], whose module
definition is contained in the directory \f[CB]mlib\f[R].
.IP
.nf
\f[CB]
jlink\ \-\-module\-path\ mlib\ \-\-add\-modules\ com.greetings\ \-\-output\ greetingsapp
\f[R]
.fi
.PP
The following command lists the modules in the runtime image
\f[CB]greetingsapp\f[R]:
.IP
.nf
\f[CB]
greetingsapp/bin/java\ \-\-list\-modules
com.greetings
java.base\@11
java.logging\@11
org.astro\@1.0
\f[R]
.fi
.PP
The following command creates a runtime image in the directory
compressedrt that\[aq]s stripped of debug symbols, uses compression to
reduce space, and includes French language locale information:
.IP
.nf
\f[CB]
jlink\ \-\-add\-modules\ jdk.localedata\ \-\-strip\-debug\ \-\-compress=2\ \-\-include\-locales=fr\ \-\-output\ compressedrt
\f[R]
.fi
.PP
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
debug symbols and doesn\[aq]t use compression:
.IP
.nf
\f[CB]
jlink\ \-\-add\-modules\ jdk.localedata\ \-\-include\-locales=fr\ \-\-output\ fr_rt
du\ \-sh\ ./compressedrt\ ./fr_rt
23M\ \ \ \ \ ./compressedrt
36M\ \ \ \ \ ./fr_rt
\f[R]
.fi
.PP
The following example lists the providers that implement
\f[CB]java.security.Provider\f[R]:
.IP
.nf
\f[CB]
jlink\ \-\-suggest\-providers\ java.security.Provider
Suggested\ providers:
\ \ java.naming\ 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.smartcardio\ 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.ec\ 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
\f[R]
.fi
.PP
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[CB]jdk.crypto.cryptoki\f[R] and their dependencies but no other
providers.
Note that these dependencies must exist in the module path:
.IP
.nf
\f[CB]
jlink\ \-\-add\-modules\ java.naming,jdk.crypto.cryptoki\ \-\-output\ mybuild
\f[R]
.fi
.PP
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
resolved from root modules with service binding; see the
\f[B]\f[BC]Configuration.resolveAndBind\f[B]\f[R]
[https://docs.oracle.com/javase/10/docs/api/java/lang/module/Configuration.html#resolveAndBind\-java.lang.module.ModuleFinder\-java.util.List\-java.lang.module.ModuleFinder\-java.util.Collection\-]
method.
.IP
.nf
\f[CB]
jlink\ \-\-module\-path\ mlib\ \-\-add\-modules\ com.greetings\ \-\-output\ greetingsapp\ \-\-bind\-services
\f[R]
.fi
.PP
The following command lists the modules in the runtime image
greetingsapp created by this command:
.IP
.nf
\f[CB]
greetingsapp/bin/java\ \-\-list\-modules
com.greetings
java.base\@11
java.compiler\@11
java.datatransfer\@11
java.desktop\@11
java.logging\@11
java.management\@11
java.management.rmi\@11
java.naming\@11
java.prefs\@11
java.rmi\@11
java.security.jgss\@11
java.security.sasl\@11
java.smartcardio\@11
java.xml\@11
java.xml.crypto\@11
jdk.accessibility\@11
jdk.charsets\@11
jdk.compiler\@11
jdk.crypto.cryptoki\@11
jdk.crypto.ec\@11
jdk.crypto.mscapi\@11
jdk.internal.opt\@11
jdk.jartool\@11
jdk.javadoc\@11
jdk.jdeps\@11
jdk.jfr\@11
jdk.jlink\@11
jdk.localedata\@11
jdk.management\@11
jdk.management.jfr\@11
jdk.naming.dns\@11
jdk.naming.rmi\@11
jdk.security.auth\@11
jdk.security.jgss\@11
jdk.zipfs\@11
org.astro\@1.0
\f[R]
.fi

View File

@ -0,0 +1,442 @@
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation.
.\"
.\" This code is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code).
.\"
.\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Automatically generated by Pandoc 2.3.1
.\"
.TH "JMOD" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
jmod \- create JMOD files and list the content of existing JMOD files
.SH SYNOPSIS
.PP
\f[CB]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[I]options\f[R]] \f[I]jmod\-file\f[R]
.PP
Includes the following:
.PP
\f[B]Main operation modes\f[R]
.TP
.B \f[CB]create\f[R]
Creates a new JMOD archive file.
.RS
.RE
.TP
.B \f[CB]extract\f[R]
Extracts all the files from the JMOD archive file.
.RS
.RE
.TP
.B \f[CB]list\f[R]
Prints the names of all the entries.
.RS
.RE
.TP
.B \f[CB]describe\f[R]
Prints the module details.
.RS
.RE
.TP
.B \f[CB]hash\f[R]
Determines leaf modules and records the hashes of the dependencies that
directly and indirectly require them.
.RS
.RE
.PP
\f[B]Options\f[R]
.TP
.B \f[I]options\f[R]
See \f[B]Options for jmod\f[R].
.RS
.RE
.PP
\f[B]Required\f[R]
.TP
.B \f[I]jmod\-file\f[R]
Specifies the name of the JMOD file to create or from which to retrieve
information.
.RS
.RE
.SH DESCRIPTION
.PP
\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
package modules in modular JAR files.
The \f[CB]jmod\f[R] tool is intended for modules that have native
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.
.PP
The JMOD file format lets you aggregate files other than
\f[CB]\&.class\f[R] files, metadata, and resources.
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.
.PP
Many \f[CB]jmod\f[R] options involve specifying a path whose contents are
copied into the resulting JMOD files.
These options copy all the contents of the specified path, including
subdirectories and their contents, but exclude files whose names match
the pattern specified by the \f[CB]\-\-exclude\f[R] option.
.PP
With the \f[CB]\-\-hash\-modules\f[R] option or the \f[CB]jmod\ hash\f[R]
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"
together these modules.
This enables a package to be exported to one or more specifically\-named
modules and to no others through qualified exports.
The runtime verifies if the recorded hash of a module matches the one
resolved at run time; if not, the runtime returns an error.
.SH OPTIONS FOR JMOD
.TP
.B \f[CB]\-\-class\-path\f[R] \f[I]path\f[R]
Specifies the location of application JAR files or a directory
containing classes to copy into the resulting JMOD file.
.RS
.RE
.TP
.B \f[CB]\-\-cmds\f[R] \f[I]path\f[R]
Specifies the location of native commands to copy into the resulting
JMOD file.
.RS
.RE
.TP
.B \f[CB]\-\-config\f[R] \f[I]path\f[R]
Specifies the location of user\-editable configuration files to copy
into the resulting JMOD file.
.RS
.RE
.TP
.B \f[CB]\-\-dir\f[R] \f[I]path\f[R]
Specifies the location where \f[CB]jmod\f[R] puts extracted files from the
specified JMOD archive.
.RS
.RE
.TP
.B \f[CB]\-\-dry\-run\f[R]
Performs a dry run of hash mode.
It identifies leaf modules and their required modules without recording
any hash values.
.RS
.RE
.TP
.B \f[CB]\-\-exclude\f[R] \f[I]pattern\-list\f[R]
Excludes files matching the supplied comma\-separated pattern list, each
element using one the following forms:
.RS
.IP \[bu] 2
\f[I]glob\-pattern\f[R]
.IP \[bu] 2
\f[CB]glob:\f[R]\f[I]glob\-pattern\f[R]
.IP \[bu] 2
\f[CB]regex:\f[R]\f[I]regex\-pattern\f[R]
.PP
See the \f[B]\f[BC]FileSystem.getPathMatcher\f[B]\f[R]
[https://docs.oracle.com/javase/10/docs/api/java/nio/file/FileSystem.html#getPathMatcher\-java.lang.String\-]
method for the syntax of \f[I]glob\-pattern\f[R].
See the \f[B]\f[BC]Pattern\f[B]\f[R]
[https://docs.oracle.com/javase/10/docs/api/java/util/regex/Pattern.html]
class for the syntax of \f[I]regex\-pattern\f[R], which represents a
regular expression.
.RE
.TP
.B \f[CB]\-\-hash\-modules\f[R] \f[I]regex\-pattern\f[R]
Determines the leaf modules and records the hashes of the dependencies
directly and indirectly requiring them, based on the module graph of the
modules matching the given \f[I]regex\-pattern\f[R].
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
\f[CB]jmod\ hash\f[R] command.
.RS
.RE
.TP
.B \f[CB]\-\-header\-files\f[R] \f[I]path\f[R]
Specifies the location of header files to copy into the resulting JMOD
file.
.RS
.RE
.TP
.B \f[CB]\-\-help\f[R] or \f[CB]\-h\f[R]
Prints a usage message.
.RS
.RE
.TP
.B \f[CB]\-\-help\-extra\f[R]
Prints help for extra options.
.RS
.RE
.TP
.B \f[CB]\-\-legal\-notices\f[R] \f[I]path\f[R]
Specifies the location of legal notices to copy into the resulting JMOD
file.
.RS
.RE
.TP
.B \f[CB]\-\-libs\f[R] \f[I]path\f[R]
Specifies location of native libraries to copy into the resulting JMOD
file.
.RS
.RE
.TP
.B \f[CB]\-\-main\-class\f[R] \f[I]class\-name\f[R]
Specifies main class to record in the module\-info.class file.
.RS
.RE
.TP
.B \f[CB]\-\-man\-pages\f[R] \f[I]path\f[R]
Specifies the location of man pages to copy into the resulting JMOD
file.
.RS
.RE
.TP
.B \f[CB]\-\-module\-version\f[R] \f[I]module\-version\f[R]
Specifies the module version to record in the module\-info.class file.
.RS
.RE
.TP
.B \f[CB]\-\-module\-path\f[R] \f[I]path\f[R] or \f[CB]\-p\f[R] \f[I]path\f[R]
Specifies the module path.
This option is required if you also specify \f[CB]\-\-hash\-modules\f[R].
.RS
.RE
.TP
.B \f[CB]\-\-target\-platform\f[R] \f[I]platform\f[R]
Specifies the target platform.
.RS
.RE
.TP
.B \f[CB]\-\-version\f[R]
Prints version information of the \f[CB]jmod\f[R] tool.
.RS
.RE
.TP
.B \f[CB]\@\f[R]\f[I]filename\f[R]
Reads options from the specified file.
.RS
.PP
An options file is a text file that contains the options and values that
you would ordinarily enter in a command prompt.
Options may appear on one line or on several lines.
You may not specify environment variables for path names.
You may comment out lines by prefixinga hash symbol (\f[CB]#\f[R]) to the
beginning of the line.
.PP
The following is an example of an options file for the \f[CB]jmod\f[R]
command:
.IP
.nf
\f[CB]
#Wed\ Dec\ 07\ 00:40:19\ EST\ 2016
create\ \-\-class\-path\ mods/com.greetings\ \-\-module\-path\ mlib
\ \ \-\-cmds\ commands\ \-\-config\ configfiles\ \-\-header\-files\ src/h
\ \ \-\-libs\ lib\ \-\-main\-class\ com.greetings.Main
\ \ \-\-man\-pages\ man\ \-\-module\-version\ 1.0
\ \ \-\-os\-arch\ "x86_x64"\ \-\-os\-name\ "Mac\ OS\ X"
\ \ \-\-os\-version\ "10.10.5"\ greetingsmod
\f[R]
.fi
.RE
.SH EXTRA OPTIONS FOR JMOD
.PP
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.
.TP
.B \f[CB]\-\-do\-not\-resolve\-by\-default\f[R]
Exclude from the default root set of modules
.RS
.RE
.TP
.B \f[CB]\-\-warn\-if\-resolved\f[R]
Hint for a tool to issue a warning if the module is resolved.
One of deprecated, deprecated\-for\-removal, or incubating.
.RS
.RE
.SH JMOD CREATE EXAMPLE
.PP
The following is an example of creating a JMOD file:
.IP
.nf
\f[CB]
jmod\ create\ \-\-class\-path\ mods/com.greetings\ \-\-cmds\ commands
\ \ \-\-config\ configfiles\ \-\-header\-files\ src/h\ \-\-libs\ lib
\ \ \-\-main\-class\ com.greetings.Main\ \-\-man\-pages\ man\ \-\-module\-version\ 1.0
\ \ \-\-os\-arch\ "x86_x64"\ \-\-os\-name\ "Mac\ OS\ X"
\ \ \-\-os\-version\ "10.10.5"\ greetingsmod
\f[R]
.fi
.SH JMOD HASH EXAMPLE
.PP
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
(\f[CB]mb\f[R]), and the hash value recorded in the required module
doesn\[aq]t match that of the leaf module.
.IP "1." 3
Create and compile the following \f[CB]\&.java\f[R] files:
.RS 4
.IP \[bu] 2
\f[CB]jmodhashex/src/ma/module\-info.java\f[R]
.RS 2
.IP
.nf
\f[CB]
module\ ma\ {
\ \ requires\ mb;
}
\f[R]
.fi
.RE
.IP \[bu] 2
\f[CB]jmodhashex/src/mb/module\-info.java\f[R]
.RS 2
.IP
.nf
\f[CB]
module\ mb\ {
}
\f[R]
.fi
.RE
.IP \[bu] 2
\f[CB]jmodhashex2/src/ma/module\-info.java\f[R]
.RS 2
.IP
.nf
\f[CB]
module\ ma\ {
\ \ requires\ mb;
}
\f[R]
.fi
.RE
.IP \[bu] 2
\f[CB]jmodhashex2/src/mb/module\-info.java\f[R]
.RS 2
.IP
.nf
\f[CB]
module\ mb\ {
}
\f[R]
.fi
.RE
.RE
.IP "2." 3
Create a JMOD archive for each module.
Create the directories \f[CB]jmodhashex/jmods\f[R] and
\f[CB]jmodhashex2/jmods\f[R], and then run the following commands from the
\f[CB]jmodhashex\f[R] directory, then from the \f[CB]jmodhashex2\f[R]
directory:
.RS 4
.IP \[bu] 2
\f[CB]jmod\ create\ \-\-class\-path\ mods/ma\ jmods/ma.jmod\f[R]
.IP \[bu] 2
\f[CB]jmod\ create\ \-\-class\-path\ mods/mb\ jmods/mb.jmod\f[R]
.RE
.IP "3." 3
Optionally preview the \f[CB]jmod\ hash\f[R] command.
Run the following command from the \f[CB]jmodhashex\f[R] directory:
.RS 4
.PP
\f[CB]jmod\ hash\ \-\-dry\-run\ \-module\-path\ jmods\ \-\-hash\-modules\ .*\f[R]
.PP
The command prints the following:
.IP
.nf
\f[CB]
Dry\ run:
mb
\ \ hashes\ ma\ SHA\-256\ 07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a
\f[R]
.fi
.PP
This indicates that the \f[CB]jmod\ hash\f[R] command (without the
\f[CB]\-\-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].
.RE
.IP "4." 3
Record hash values in the JMOD archive files contained in the
\f[CB]jmodhashex\f[R] directory.
Run the following command from the \f[CB]jmodhashex\f[R] directory:
.RS 4
.RS
.PP
\f[CB]jmod\ hash\ \-\-module\-path\ jmods\ \-\-hash\-modules\ .*\f[R]
.RE
.PP
The command prints the following:
.RS
.PP
\f[CB]Hashes\ are\ recorded\ in\ module\ mb\f[R]
.RE
.RE
.IP "5." 3
Print information about each JMOD archive contained in the
\f[CB]jmodhashex\f[R] directory.
Run the highlighted commands from the \f[CB]jmodhashex\f[R] directory:
.RS 4
.IP
.nf
\f[CB]
jmod\ describe\ jmods/ma.jmod
ma
\ \ requires\ mandated\ java.base
\ \ requires\ mb
jmod\ describe\ jmods/mb.jmod
mb
\ \ requires\ mandated\ java.base
\ \ hashes\ ma\ SHA\-256\ 07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a
\f[R]
.fi
.RE
.IP "6." 3
Attempt to create a runtime image that contains the module \f[CB]ma\f[R]
from the directory \f[CB]jmodhashex2\f[R] but the module \f[CB]mb\f[R] from
the directory \f[CB]jmodhashex\f[R].
Run the following command from the \f[CB]jmodhashex2\f[R] directory:
.RS 4
.IP \[bu] 2
\f[B]Oracle Solaris, Linux, and OS X:\f[R]
.RS 2
.RS
.PP
\f[CB]jlink\ \-\-module\-path\ $JAVA_HOME/jmods:jmods/ma.jmod:../jmodhashex/jmods/mb.jmod\ \-\-add\-modules\ ma\ \-\-output\ ma\-app\f[R]
.RE
.RE
.IP \[bu] 2
\f[B]Windows:\f[R]
.RS 2
.RS
.PP
\f[CB]jlink\ \-\-module\-path\ %JAVA_HOME%/jmods;jmods/ma.jmod;../jmodhashex/jmods/mb.jmod\ \-\-add\-modules\ ma\ \-\-output\ ma\-app\f[R]
.RE
.RE
.PP
The command prints an error message similar to the following:
.IP
.nf
\f[CB]
Error:\ Hash\ of\ ma\ (a2d77889b0cb067df02a3abc39b01ac1151966157a68dc4241562c60499150d2)\ differs\ to
expected\ hash\ (07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a)\ recorded\ in\ mb
\f[R]
.fi
.RE

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,190 +19,182 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Monitoring Tools
.\" Title: jstatd.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&.
.SH SYNOPSIS
.sp
.nf
\fBjstatd\fR [ \fIoptions\fR ]
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.SH DESCRIPTION
The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&.
.TH "JSTATD" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&.
.SH OPTIONS
.TP
-nr
.br
Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&.
.TP
-p \fIport\fR
.br
The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&.
.TP
-n \fIrminame\fR
.br
Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&.
.TP
-J\fIoption\fR
.br
Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.SH SECURITY
The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&.
jstatd \- monitor the creation and termination of instrumented Java
HotSpot VMs
.SH SYNOPSIS
.PP
The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&.
\f[B]Note:\f[R] This command is experimental\ and unsupported.
.PP
The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
.PP
The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&.
.sp
.nf
\f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { \fP
.fi
.nf
\f3 permission java\&.security\&.AllPermission;\fP
.fi
.nf
\f3};\fP
.fi
.nf
\f3\fP
.fi
.sp
To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows:
.sp
.nf
\f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP
.fi
.nf
\f3\fP
.fi
.sp
For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&.
.SH REMOTE\ INTERFACE
The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&.
.SH EXAMPLES
The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background
.SS INTERNAL\ RMI\ REGISTRY
This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&.
.sp
.nf
\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
.fi
.nf
\f3\fP
.fi
.sp
.SS EXTERNAL\ RMI\ REGISTRY
This example starts a \f3jstatd\fR session with a external RMI registry\&.
.sp
.nf
\f3rmiregistry&\fP
.fi
.nf
\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
.fi
.nf
\f3\fP
.fi
.sp
This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&.
.sp
.nf
\f3jrmiregistry 2020&\fP
.fi
.nf
\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
.fi
.nf
\f3\fP
.fi
.sp
This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&.
.sp
.nf
\f3rmiregistry 2020&\fP
.fi
.nf
\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
.fi
.nf
\f3 \-n AlternateJstatdServerName\fP
.fi
.nf
\f3\fP
.fi
.sp
.SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY
This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&.
.sp
.nf
\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP
.fi
.nf
\f3\fP
.fi
.sp
.SS ENABLE\ RMI\ LOGGING
This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&.
.sp
.nf
\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
.fi
.nf
\f3 \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH SEE\ ALSO
.TP 0.2i
\(bu
java(1)
.TP 0.2i
\(bu
jps(1)
.TP 0.2i
\(bu
jstat(1)
.TP 0.2i
\(bu
rmiregistry(1)
\f[CB]jstatd\f[R] [\f[I]options\f[R]]
.TP
.B \f[I]options\f[R]
This represents the \f[CB]jstatd\f[R] command\-line options.
See \f[B]Options for the jstatd Command\f[R].
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]jstatd\f[R] command is an RMI server application that monitors
for the creation and termination of instrumented Java HotSpot VMs and
provides an interface to enable remote monitoring tools, \f[CB]jstat\f[R]
and \f[CB]jps\f[R], to attach to JVMs that are running on the local host
and collect information about the JVM process.
.PP
The \f[CB]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
default port, or on the port you specify with the \f[CB]\-p\f[R]
\f[CB]port\f[R] option.
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
indicated by the \f[CB]\-p\f[R] \f[CB]port\f[R] option or to the default RMI
registry port when the \f[CB]\-p\f[R] \f[CB]port\f[R] option is omitted.
You can stop the creation of an internal RMI registry by specifying the
\f[CB]\-nr\f[R] option.
.SH OPTIONS FOR THE JSTATD COMMAND
.TP
.B \f[CB]\-nr\f[R]
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
found.
.RS
.RE
.TP
.B \f[CB]\-p\f[R] \f[I]port\f[R]
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
isn\[aq]t specified.
.RS
.RE
.TP
.B \f[CB]\-n\f[R] \f[I]rminame\f[R]
This option sets the name to which the remote RMI object is bound in the
RMI registry.
The default name is \f[CB]JStatRemoteHost\f[R].
If multiple \f[CB]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
by specifying this option.
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.
.RS
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]option\f[R]
This option passes a Java \f[CB]option\f[R] to the JVM, where the option
is one of those described on the reference page for the Java application
launcher.
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB.
See \f[B]java\f[R].
.RS
.RE
.SH SECURITY
.PP
The \f[CB]jstatd\f[R] server can monitor only JVMs for which it has the
appropriate native access permissions.
Therefore, the \f[CB]jstatd\f[R] process must be running with the same
user credentials as the target JVMs.
Some user credentials, such as the root user in Oracle Solaris, Linux,
and OS X operating systems, have permission to access the
instrumentation exported by any JVM on the system.
A \f[CB]jstatd\f[R] process running with such credentials can monitor any
JVM on the system, but introduces additional security concerns.
.PP
The \f[CB]jstatd\f[R] server doesn\[aq]t provide any authentication of
remote clients.
Therefore, running a \f[CB]jstatd\f[R] server process exposes the
instrumentation export by all JVMs for which the \f[CB]jstatd\f[R] process
has access permissions to any user on the network.
This exposure might be undesirable in your environment, and therefore,
local security policies should be considered before you start the
\f[CB]jstatd\f[R] process, particularly in production environments or on
networks that aren\[aq]t secure.
.PP
The \f[CB]jstatd\f[R] server installs an instance of
\f[CB]RMISecurityPolicy\f[R] when no other security manager is installed,
and therefore, requires a security policy file to be specified.
The policy file must conform to Default Policy Implementation and Policy
File Syntax.
.PP
If your security concerns can\[aq]t be addressed with a customized
policy file, then the safest action is to not run the \f[CB]jstatd\f[R]
server and use the \f[CB]jstat\f[R] and \f[CB]jps\f[R] tools locally.
However, when using \f[CB]jps\f[R] to get a list of instrumented JVMs, the
list will not include any JVMs running in docker containers.
.SH REMOTE INTERFACE
.PP
The interface exported by the \f[CB]jstatd\f[R] process is proprietary and
guaranteed to change.
Users and developers are discouraged from writing to this interface.
.SH EXAMPLES
.PP
The following are examples of the \f[CB]jstatd\f[R] command.
The \f[CB]jstatd\f[R] scripts automatically start the server in the
background.
.SH INTERNAL RMI REGISTRY
.PP
This example shows how to start a \f[CB]jstatd\f[R] session with an
internal RMI registry.
This example assumes that no other server is bound to the default RMI
registry port (port \f[CB]1099\f[R]).
.RS
.PP
\f[CB]jstatd\ \-J\-Djava.security.policy=all.policy\f[R]
.RE
.SH EXTERNAL RMI REGISTRY
.PP
This example starts a \f[CB]jstatd\f[R] session with an external RMI
registry.
.IP
.nf
\f[CB]
rmiregistry&
jstatd\ \-J\-Djava.security.policy=all.policy
\f[R]
.fi
.PP
This example starts a \f[CB]jstatd\f[R] session with an external RMI
registry server on port \f[CB]2020\f[R].
.IP
.nf
\f[CB]
jrmiregistry\ 2020&
jstatd\ \-J\-Djava.security.policy=all.policy\ \-p\ 2020
\f[R]
.fi
.PP
This example starts a \f[CB]jstatd\f[R] session with an external RMI
registry on port 2020 that\[aq]s bound to
\f[CB]AlternateJstatdServerName\f[R].
.IP
.nf
\f[CB]
rmiregistry\ 2020&
jstatd\ \-J\-Djava.security.policy=all.policy\ \-p\ 2020\ \-n\ AlternateJstatdServerName
\f[R]
.fi
.SH STOP THE CREATION OF AN IN\-PROCESS RMI REGISTRY
.PP
This example starts a \f[CB]jstatd\f[R] session that doesn\[aq]t create an
RMI registry when one isn\[aq]t found.
This example assumes an RMI registry is already running.
If an RMI registry isn\[aq]t running, then an error message is
displayed.
.RS
.PP
\f[CB]jstatd\ \-J\-Djava.security.policy=all.policy\ \-nr\f[R]
.RE
.SH ENABLE RMI LOGGING
.PP
This example starts a \f[CB]jstatd\f[R] session with RMI logging
capabilities enabled.
This technique is useful as a troubleshooting aid or for monitoring
server activities.
.RS
.PP
\f[CB]jstatd\ \-J\-Djava.security.policy=all.policy\ \-J\-Djava.rmi.server.logCalls=true\f[R]
.RE
.br
'pl 8.5i
'bp

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,271 +19,339 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Java Deployment Tools
.\" Title: pack200.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
pack200 \- Packages a JAR file into a compressed pack200 file for web deployment\&.
.SH SYNOPSIS
.sp
.nf
\fBpack200\fR [\fIoptions\fR] \fIoutput\-file\fR \fIJAR\-file\fR
.fi
.sp
Options can be in any order\&. The last option on the command line or in a properties file supersedes all previously specified options\&.
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fIoutput-file\fR
Name of the output file\&.
.TP
\fIJAR-file\fR
Name of the input file\&.
.SH DESCRIPTION
The \f3pack200\fR command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor\&. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time\&.
.TH "PACK200" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
The \f3pack200\fR command has several options to fine-tune and set the compression engine\&. The typical usage is shown in the following example, where \f3myarchive\&.pack\&.gz\fR is produced with the default \f3pack200\fR command settings:
.sp
.nf
\f3pack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH OPTIONS
.TP
-r, --repack
.br
Produces a JAR file by packing and unpacking a JAR file\&. The resulting file can be used as an input to the \f3jarsigner\fR(1) tool\&. The following example packs and unpacks the myarchive\&.jar file:
.sp
.nf
\f3pack200 \-\-repack myarchive\-packer\&.jar myarchive\&.jar\fP
.fi
.nf
\f3pack200 \-\-repack myarchive\&.jar\fP
.fi
.nf
\f3\fP
.fi
.sp
The following example preserves the order of files in the input file\&.
.TP
-g, --no-gzip
.br
Produces a \f3pack200\fR file\&. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser\&.
.sp
.nf
\f3pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
-G, --strip-debug
.br
Strips debugging attributes from the output\&. These include \f3SourceFile\fR, \f3LineNumberTable\fR, \f3LocalVariableTable\fR and \f3LocalVariableTypeTable\fR\&. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers\&.
.TP
--keep-file-order
.br
Preserve the order of files in the input file\&. This is the default behavior\&.
.TP
-O, --no-keep-file-order
.br
The packer reorders and transmits all elements\&. The packer can also remove JAR directory names to reduce the download size\&. However, certain JAR file optimizations, such as indexing, might not work correctly\&.
.TP
-S\fIvalue\fR , --segment-limit=\fIvalue\fR
.br
The value is the estimated target size \fIN\fR (in bytes) of each archive segment\&. If a single input file requires more than \fIN\fR bytes, then its own archive segment is provided\&. As a special case, a value of \f3-1\fR produces a single large segment with all input files, while a value of 0 produces one segment for each class\&. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory\&.
The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties\&.
The default is -1, which means that the packer creates a single segment output file\&. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs\&.
A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit)\&.
.TP
-E\fIvalue\fR , --effort=\fIvalue\fR
.br
If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive\&. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression\&. The special value 0 instructs the \f3pack200\fR command to copy through the original JAR file directly with no compression\&. The JSR 200 standard requires any unpacker to understand this special case as a pass-through of the entire archive\&.
The default is 5, to invest a modest amount of time to produce reasonable compression\&.
.TP
-H\fIvalue\fR , --deflate-hint=\fIvalue\fR
.br
Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger\&. The possible values are: \f3true\fR, \f3false\fR, or \f3keep\fR\&.
If the \f3value\fR is \f3true\fR or false, then the \f3packer200\fR command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements\&.
The \f3keep\fR value preserves deflation hints observed in the input JAR\&. This is the default\&.
.TP
-m\fIvalue\fR , --modification-time=\fIvalue\fR
.br
The possible values are \f3latest\fR and \f3keep\fR\&.
If the value is latest, then the packer attempts to determine the latest modification time, among all the available entries in the original archive, or the latest modification time of all the available entries in that segment\&. This single value is transmitted as part of the segment and applied to all the entries in each segment\&. This can marginally decrease the transmitted size of the archive at the expense of setting all installed files to a single date\&.
If the value is \f3keep\fR, then modification times observed in the input JAR are preserved\&. This is the default\&.
.TP
-P\fIfile\fR , --pass-file=\fIfile\fR
.br
Indicates that a file should be passed through bytewise with no compression\&. By repeating the option, multiple files can be specified\&. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/)\&. The resulting file names must match exactly as strings with their occurrences in the JAR file\&. If \f3file\fR is a directory name, then all files under that directory are passed\&.
.TP
-U\fIaction\fR , --unknown-attribute=\fIaction\fR
.br
Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action\fR\&. The possible values for actions are \f3error\fR, \f3strip\fR, or \f3pass\fR\&.
If the value is \f3error\fR, then the entire \f3pack200\fR command operation fails with a suitable explanation\&.
If the value is \f3strip\fR, then the attribute is dropped\&. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures\&.
If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
.TP
.nf
-C\fIattribute-name\fR=\fIlayout\fR , --class-attribute=\fIattribute-name\fR=\fIaction\fR
.br
.fi
See next option\&.
.TP
.nf
-F\fIattribute-name\fR=\fIlayout\fR , --field-attribute=\fIattribute-name\fR=\fIaction\fR
.br
.fi
See next option\&.
.TP
.nf
-M\fIattribute-name\fR=\fIlayout\fR , --method-attribute=\fIattribute-name\fR=\fIaction\fR
.br
.fi
See next option\&.
.TP
.nf
-D\fIattribute-name\fR=\fIlayout\fR , --code-attribute=\fIattribute-name\fR=\fIaction\fR
.br
.fi
With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute\fR, \f3field-attribute\fR, \f3method-attribute\fR, and \f3code-attribute\fR\&. The \fIattribute-name\fR is the name of the attribute for which the layout or action is being defined\&. The possible values for \fIaction\fR are \f3some-layout-string\fR, \f3error\fR, \f3strip\fR, \f3pass\fR\&.
\f3some-layout-string\fR: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH\fR\&.
If the value is \f3error\fR, then the \f3pack200\fR operation fails with an explanation\&.
If the value is \f3strip\fR, then the attribute is removed from the output\&. Removing JVM-required attributes can cause class loader failures\&. For example, \f3--class-attribute=CompilationID=pass\fR causes the class file that contains this attribute to be passed through without further action by the packer\&.
If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
.TP
-f \fIpack\&.properties\fR , --config-file=\fIpack\&.properties\fR
.br
A configuration file, containing Java properties to initialize the packer, can be specified on the command line\&.
.sp
.nf
\f3pack200 \-f pack\&.properties myarchive\&.pack\&.gz myarchive\&.jar\fP
.fi
.nf
\f3more pack\&.properties\fP
.fi
.nf
\f3# Generic properties for the packer\&.\fP
.fi
.nf
\f3modification\&.time=latest\fP
.fi
.nf
\f3deflate\&.hint=false\fP
.fi
.nf
\f3keep\&.file\&.order=false\fP
.fi
.nf
\f3# This option will cause the files bearing new attributes to\fP
.fi
.nf
\f3# be reported as an error rather than passed uncompressed\&.\fP
.fi
.nf
\f3unknown\&.attribute=error\fP
.fi
.nf
\f3# Change the segment limit to be unlimited\&.\fP
.fi
.nf
\f3segment\&.limit=\-1\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
-v, --verbose
.br
Outputs minimal messages\&. Multiple specification of this option will create more verbose messages\&.
.TP
-q, --quiet
.br
Specifies quiet operation with no messages\&.
.TP
-l\fIfilename\fR , --log-file=\fIfilename\fR
.br
Specifies a log file to output messages\&.
.TP
-?, -h, --help
.br
Prints help information about this command\&.
.TP
-V, --version
.br
Prints version information about this command\&.
.TP
-J\fIoption\fR
.br
Passes the specified option to the Java Virtual Machine\&. For more information, see the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
.SH EXIT\ STATUS
The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs\&.
.SH NOTES
This command should not be confused with \f3pack\fR(1)\&. The \f3pack\fR and \f3pack200\fR commands are separate products\&.
pack200 \- transform a Java Archive (JAR) file into a compressed pack200
file with the Java gzip compressor
.SH SYNOPSIS
.PP
The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
unpack200(1)
.TP 0.2i
\(bu
jar(1)
.TP 0.2i
\(bu
jarsigner(1)
\f[CB]pack200\f[R] [\f[I]\-opt...\f[R] | \f[I]\-\-option=value\f[R]]
\f[I]x.pack[.gz]\f[R] \f[I]JAR\-file\f[R]
.TP
.B \f[I]\-opt...\f[R] | \f[I]\-\-option=value\f[R]
Options can be in any order.
The last option on the command line or in a properties file supersedes
all previously specified options.
See \f[B]Options for the pack200 Command\f[R].
.RS
.RE
.TP
.B \f[I]x.pack[.gz]\f[R]
Name of the output file.
.RS
.RE
.TP
.B \f[I]JAR\-file\f[R]
Name of the input file.
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]pack200\f[R] command is a Java application that transforms a JAR
file into a compressed \f[CB]pack200\f[R] file with the Java gzip
compressor.
This command packages a JAR file into a compressed \f[CB]pack200\f[R] file
for web deployment.
The \f[CB]pack200\f[R] files are highly compressed files that can be
directly deployed to save bandwidth and reduce download time.
.PP
Typical usage is shown in the following example, where
\f[CB]myarchive.pack.gz\f[R] is produced with the default \f[CB]pack200\f[R]
command settings:
.RS
.PP
\f[CB]pack200\ myarchive.pack.gz\ myarchive.jar\f[R]
.RE
.PP
\f[B]Note:\f[R]
.PP
This command shouldn\[aq]t be confused with \f[CB]pack\f[R].
The \f[CB]pack\f[R] and \f[CB]pack200\f[R] commands are separate products.
The Java SE API Specification provided with the JDK is the superseding
authority, when there are discrepancies.
.SH EXIT STATUS
.PP
The following exit values are returned: 0 for successful completion and
a number greater than 0 when an error occurs.
.SH OPTIONS FOR THE PACK200 COMMAND
.PP
The \f[CB]pack200\f[R] command has several options to fine\-tune and set
the compression engine.
The typical usage is shown in the following example, where
\f[CB]myarchive.pack.gz\f[R] is produced with the default \f[CB]pack200\f[R]
command settings:
.RS
.PP
\f[CB]pack200\ myarchive.pack.gz\ myarchive.jar\f[R]
.RE
.TP
.B \f[CB]\-r\f[R] or \f[CB]\-\-repack\f[R]
Produces a JAR file by packing and unpacking a JAR file.
The resulting file can be used as an input to the \f[CB]jarsigner\f[R]
tool.
The following example packs and unpacks the myarchive.jar file:
.RS
.RS
.PP
\f[CB]pack200\ \-\-repack\ myarchive\-packer.jar\ myarchive.jar\f[R]
.RE
.RS
.PP
\f[CB]pack200\ \-\-repack\ myarchive.jar\f[R]
.RE
.RE
.TP
.B \f[CB]\-g\f[R] or\f[CB]\-\-no\-gzip\f[R]
Produces a \f[CB]pack200\f[R] file.
With this option, a suitable compressor must be used, and the target
system must use a corresponding decompresser.
.RS
.RS
.PP
\f[CB]pack200\ \-\-no\-gzip\ myarchive.pack\ myarchive.jar\f[R]
.RE
.RE
.TP
.B \f[CB]\-\-gzip\f[R]
(Default) Post\-compresses the pack output with \f[CB]gzip\f[R].
.RS
.RE
.TP
.B \f[CB]\-G\f[R] or \f[CB]\-\-strip\-debug\f[R]
Strips debugging attributes from the output.
These include \f[CB]SourceFile\f[R], \f[CB]LineNumberTable\f[R],
\f[CB]LocalVariableTable\f[R] and \f[CB]LocalVariableTypeTable\f[R].
Removing these attributes reduces the size of both downloads and
installations, also reduces the usefulness of debuggers.
.RS
.RE
.TP
.B \f[CB]\-\-keep\-file\-order\f[R]
Preserves the order of files in the input file.
This is the default behavior.
.RS
.RE
.TP
.B \f[CB]\-O\f[R] or\f[CB]\-\-no\-keep\-file\-order\f[R]
Reorders and transmits all elements.
The packer can also remove JAR directory names to reduce the download
size.
However, certain JAR file optimizations, such as indexing, might not
work correctly.
.RS
.RE
.TP
.B \f[CB]\-S\f[R]\f[I]N\f[R] or \f[CB]\-\-segment\-limit=\f[R]\f[I]N\f[R]
The value is the estimated target size \f[I]N\f[R] (in bytes) of each
archive segment.
If a single input file requires more than \f[I]N\f[R] bytes, then its own
archive segment is provided.
As a special case, a value of \f[CB]\-1\f[R] produces a single large
segment with all input files, while a value of 0 produces one segment
for each class.
Larger archive segments result in less fragmentation and better
compression, but processing them requires more memory.
.RS
.PP
The size of each segment is estimated by counting the size of each input
file to be transmitted in the segment with the size of its name and
other transmitted properties.
.PP
The default is \f[CB]\-1\f[R], which means that the packer creates a
single segment output file.
In cases where extremely large output files are generated, users are
strongly encouraged to use segmenting or break up the input file into
smaller JAR file.
.PP
A 10 MB JAR packed without this limit typically packs about 10 percent
smaller, but the packer might require a larger Java heap (about 10 times
the segment limit).
.RE
.TP
.B \f[CB]\-E\f[R]\f[I]value\f[R] or \f[CB]\-\-effort=\f[R]\f[I]value\f[R]
If the value is set to a single decimal digit, then the packer uses the
indicated amount of effort in compressing the archive.
Level 1 might produce somewhat larger size and faster compression speed,
while level 9 takes much longer, but can produce better compression.
The special value 0 instructs the \f[CB]pack200\f[R] command to copy
through the original JAR file directly with no compression.
The JSR 200 standard requires any unpacker to understand this special
case as a pass\-through of the entire archive.
.RS
.PP
The default is 5, to invest a modest amount of time to produce
reasonable compression.
.RE
.TP
.B \f[CB]\-H\f[R]\f[I]value\f[R] or \f[CB]\-\-deflate\-hint=\f[R]\f[I]value\f[R]
Overrides the default, which preserves the input information, but can
cause the transmitted archive to be larger.
The possible values are: \f[CB]true\f[R], \f[CB]false\f[R], or
\f[CB]keep\f[R].
.RS
.PP
If the \f[CB]value\f[R] is \f[CB]true\f[R] or false, then the
\f[CB]packer200\f[R] command sets the deflation hint accordingly in the
output archive and doesn\[aq]t transmit the individual deflation hints
of archive elements.
.PP
The \f[CB]keep\f[R] value preserves deflation hints observed in the input
JAR.
This is the default.
.RE
.TP
.B \f[CB]\-m\f[R]\f[I]value\f[R] or \f[CB]\-\-modification\-time=\f[R]\f[I]value\f[R]
The possible values are \f[CB]latest\f[R] and \f[CB]keep\f[R].
.RS
.PP
If the value is \f[CB]latest\f[R], then the packer attempts to determine
the latest modification time, among all the available entries in the
original archive, or the latest modification time of all the available
entries in that segment.
This single value is transmitted as part of the segment and applied to
all the entries in each segment.
This can marginally decrease the transmitted size of the archive at the
expense of setting all installed files to a single date.
.PP
If the value is \f[CB]keep\f[R], then modification times observed in the
input JAR are preserved.
This is the default.
.RE
.TP
.B \f[CB]\-P\f[R]\f[I]file\f[R] or \f[CB]\-\-pass\-file=\f[R]\f[I]file\f[R]
Indicates that a file should be passed through bytewise with no
compression.
By repeating the option, multiple files can be specified.
There is no path name transformation, except that the system file
separator is replaced by the JAR file separator forward slash (/).
The resulting file names must match exactly as strings with their
occurrences in the JAR file.
If \f[I]file\f[R] is a directory name, then all files under that
directory are passed.
.RS
.RE
.TP
.B \f[CB]\-U\f[R]\f[I]action\f[R] or \f[CB]\-\-unknown\-attribute=\f[R]\f[I]action\f[R]
Overrides the default behavior, which means that the class file that
contains the unknown attribute is passed through with the specified
\f[I]action\f[R].
The possible values for actions are \f[CB]error\f[R], \f[CB]strip\f[R], or
\f[CB]pass\f[R].
.RS
.PP
If the value is \f[CB]error\f[R], then the entire \f[CB]pack200\f[R] command
operation fails with a suitable explanation.
.PP
If the value is \f[CB]strip\f[R], then the attribute is dropped.
Removing the required Java Virtual Machine (JVM) attributes can cause
class loader failures.
.PP
If the value is \f[CB]pass\f[R], then the entire class is transmitted as
though it is a resource.
.RE
.TP
.B \f[CB]\-C\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R] or \f[CB]\-\-class\-attribute=\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R]
(user\-defined attribute) See the description for
\f[CB]\-D\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R].
.RS
.RE
.TP
.B \f[CB]\-F\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R] or \f[CB]\-\-field\-attribute=\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R]
(user\-defined attribute) See the description for
\f[CB]\-D\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R].
.RS
.RE
.TP
.B \f[CB]\-M\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R] or \f[CB]\-\-method\-attribute=\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R]
(user\-defined attribute) See the description for
\f[CB]\-D\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R].
.RS
.RE
.TP
.B \f[CB]\-D\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R] or \f[CB]\-\-code\-attribute=\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R]
(user\-defined attribute) The attribute layout can be specified for a
class entity, such as \f[CB]class\-attribute\f[R],
\f[CB]field\-attribute\f[R], \f[CB]method\-attribute\f[R], and
\f[CB]code\-attribute\f[R].
The \f[I]attribute\-name\f[R] is the name of the attribute for which the
layout or action is being defined.
The possible values for \f[I]action\f[R] are
\f[I]some\-layout\-string\f[R], \f[CB]error\f[R], \f[CB]strip\f[R],
\f[CB]pass\f[R].
.RS
.PP
\f[I]some\-layout\-string\f[R]: The layout language is defined in the JSR
200 specification, for example:
\f[CB]\-\-class\-attribute=SourceFile=RUH\f[R].
.PP
If the value is \f[CB]error\f[R], then the \f[CB]pack200\f[R] operation
fails with an explanation.
.PP
If the value is \f[CB]strip\f[R], then the attribute is removed from the
output.
Removing JVM\-required attributes can cause class loader failures.
For example, \f[CB]\-\-class\-attribute=CompilationID=pass\f[R] causes the
class file that contains this attribute to be passed through without
further action by the packer.
.PP
If the value is \f[CB]pass\f[R], then the entire class is transmitted as
though it\[aq]s a resource.
.RE
.TP
.B \f[CB]\-f\f[R]\f[I]pack.properties\f[R] or \f[CB]\-\-config\-file=\f[R]\f[I]pack.properties\f[R]
Indicates a configuration file, containing Java properties to initialize
the packer, can be specified on the command line.
.RS
.IP
.nf
\f[CB]
pack200\ \-f\ pack.properties\ myarchive.pack.gz\ myarchive.jar
more\ pack.properties
#\ Generic\ properties\ for\ the\ packer.
modification.time=latest
deflate.hint=false
keep.file.order=false
#\ This\ option\ will\ cause\ the\ files\ bearing\ new\ attributes\ to
#\ be\ reported\ as\ an\ error\ rather\ than\ passed\ uncompressed.
unknown.attribute=error
#\ Change\ the\ segment\ limit\ to\ be\ unlimited.
segment.limit=\-1
\f[R]
.fi
.RE
.TP
.B \f[CB]\-v\f[R] or \f[CB]\-\-verbose\f[R]
Outputs minimal messages.
Multiple specification of this option will create more verbose messages.
.RS
.RE
.TP
.B \f[CB]\-q\f[R] or \f[CB]\-\-quiet\f[R]
Specifies quiet operation with no messages.
.RS
.RE
.TP
.B \f[CB]\-l\f[R]\f[I]filename\f[R] or \f[CB]\-\-log\-file=\f[R]\f[I]filename\f[R]
Specifies a log file to output messages.
.RS
.RE
.TP
.B \f[CB]\-?\f[R], \f[CB]\-h\f[R], or\f[CB]\-\-help\f[R]
Prints help information about this command.
.RS
.RE
.TP
.B \f[CB]\-V\f[R] or \f[CB]\-\-version\f[R]
Prints version information about this command.
.RS
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]option\f[R]
Passes the specified \f[I]option\f[R] to the Java Virtual Machine.
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB.
.RS
.RE
.br
'pl 8.5i
'bp

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,118 +19,108 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Java Deployment Tools
.\" Title: unpack200.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH unpack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
unpack200 \- Transforms a packed file produced by pack200(1) into a JAR file for web deployment\&.
.SH SYNOPSIS
.sp
.nf
\fBunpack200\fR [ \fIoptions\fR ] input\-file \fIJAR\-file\fR
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fIinput-file\fR
Name of the input file, which can be a pack200 gzip file or a pack200 file\&. The input can also be JAR file produced by \f3pack200\fR(1) with an effort of \f30\fR, in which case the contents of the input file are copied to the output JAR file with the Pack200 marker\&.
.TP
\fIJAR-file\fR
Name of the output JAR file\&.
.SH DESCRIPTION
The \f3unpack200\fR command is a native implementation that transforms a packed file produced by \f3pack200\fR\f3(1)\fR into a JAR file\&. A typical usage follows\&. In the following example, the \f3myarchive\&.jar\fR file is produced from \f3myarchive\&.pack\&.gz\fR with the default \f3unpack200\fR command settings\&.
.sp
.nf
\f3unpack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH OPTIONS
.TP
-Hvalue --deflate-hint=\fIvalue\fR
.br
Sets the deflation to be \f3true\fR, \f3false\fR, or \f3keep\fR on all entries within a JAR file\&. The default mode is \f3keep\fR\&. If the value is \f3true\fR or \f3false\fR, then the \f3--deflate=hint\fR option overrides the default behavior and sets the deflation mode on all entries within the output JAR file\&.
.TP
-r --remove-pack-file
.br
Removes the input pack file\&.
.TP
-v --verbose
.br
Displays minimal messages\&. Multiple specifications of this option displays more verbose messages\&.
.TP
-q --quiet
.br
Specifies quiet operation with no messages\&.
.TP
-lfilename --log-file=\fIfilename\fR
.br
Specifies a log file where output messages are logged\&.
.TP
-? -h --help
.br
Prints help information about the \f3unpack200\fR command\&.
.TP
-V --version
.br
Prints version information about the \f3unpack200\fR command\&.
.TP
-J\fIoption\fR
.br
Passes option to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.SH NOTES
This command should not be confused with the \f3unpack\fR command\&. They are distinctly separate products\&.
.TH "UNPACK200" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
The Java SE API Specification provided with the JDK is the superseding authority in case of discrepancies\&.
.SH EXIT\ STATUS
The following exit values are returned: 0 for successful completion, and a value that is greater than 0 when an error occurred\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
pack200(1)
.TP 0.2i
\(bu
jar(1)
.TP 0.2i
\(bu
jarsigner(1)
.TP 0.2i
\(bu
Pack200 and Compression at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment-guide/pack200\&.html
.TP 0.2i
\(bu
The Java SE Technical Documentation page at http://docs\&.oracle\&.com/javase/
unpack200 \- transform a packed file into a JAR file for web deployment
.SH SYNOPSIS
.PP
\f[CB]unpack200\f[R] [\f[I]options\f[R]] \f[I]input\-file\f[R]
\f[I]JAR\-file\f[R]
.TP
.B \f[I]options\f[R]
The command\-line options.
See \f[B]Options for the unpack200 Command\f[R].
.RS
.RE
.br
'pl 8.5i
'bp
.TP
.B \f[I]input\-file\f[R]
Name of the input file, which can be a \f[CB]pack200\ gzip\f[R] file or a
\f[CB]pack200\f[R] file.
The input can also be a JAR file produced by \f[CB]pack200\f[R] with an
effort of \f[CB]0\f[R], in which case the contents of the input file are
copied to the output JAR file with the \f[CB]pack200\f[R] marker.
.RS
.RE
.TP
.B \f[I]JAR\-file\f[R]
Name of the output JAR file.
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]unpack200\f[R] command is a native implementation that
transforms a packed file produced by the \f[CB]pack200\f[R] into a JAR
file for web deployment.
An example of typical usage follows.
In the following example, the \f[CB]myarchive.jar\f[R] file is produced
from \f[CB]myarchive.pack.gz\f[R] with the default \f[CB]unpack200\f[R]
command settings.
.RS
.PP
\f[CB]unpack200\ myarchive.pack.gz\ myarchive.jar\f[R]
.RE
.SH OPTIONS FOR THE UNPACK200 COMMAND
.TP
.B \f[CB]\-H\f[R]\f[I]value\f[R] or \f[CB]\-\-deflate\-hint=\f[R]\f[I]value\f[R]
Sets the deflation to be \f[CB]true\f[R], \f[CB]false\f[R], or \f[CB]keep\f[R]
on all entries within a JAR file.
The default mode is \f[CB]keep\f[R].
If the value is \f[CB]true\f[R] or \f[CB]false\f[R], then the
\f[CB]\-\-deflate=hint\f[R] option overrides the default behavior and sets
the deflation mode on all entries within the output JAR file.
.RS
.RE
.TP
.B \f[CB]\-r\f[R] or \f[CB]\-\-remove\-pack\-file\f[R]
Removes the input pack file.
.RS
.RE
.TP
.B \f[CB]\-v\f[R] or \f[CB]\-\-verbose\f[R]
Displays minimal messages.
Multiple specifications of this option displays more verbose messages.
.RS
.RE
.TP
.B \f[CB]\-q\f[R] or \f[CB]\-\-quiet\f[R]
Specifies quiet operation with no messages.
.RS
.RE
.TP
.B \f[CB]\-l\f[R] \f[I]filename\f[R] or \f[CB]\-\-log\-file=\f[R]\f[I]filename\f[R]
Specifies a log file where output messages are logged.
.RS
.RE
.TP
.B \f[CB]\-?\f[R] or \f[CB]\-h\f[R] or \f[CB]\-\-help\f[R]
Prints help information about the \f[CB]unpack200\f[R] command.
.RS
.RE
.TP
.B \f[CB]\-V\f[R] or \f[CB]\-\-version\f[R]
Prints version information about the \f[CB]unpack200\f[R] command.
.RS
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]option\f[R]
Passes \f[I]option\f[R] to the Java Virtual Machine, where
\f[CB]option\f[R] is one of the options described on the reference page
for the Java application launcher.
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB.
.RS
.RE
.SH NOTES
.PP
This command shouldn\[aq]t be confused with the \f[CB]unpack\f[R] command.
They\[aq]re distinctly separate products.
.PP
The Java SE API Specification provided with the JDK is the superseding
authority in case of discrepancies.
.SH EXIT STATUS
.PP
The following exit values are returned: 0 for successful completion, and
a value that is greater than 0 when an error occurred.

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,204 +19,243 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Remote Method Invocation (RMI) Tools
.\" Title: rmic.1
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH rmic 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
rmic \- Generates stub, skeleton, and tie classes for remote objects that use the Java Remote Method Protocol (JRMP) or Internet Inter-Orb protocol (IIOP)\&. Also generates Object Management Group (OMG) Interface Definition Language (IDL)
.SH SYNOPSIS
.sp
.nf
\fBrmic\fR [ \fIoptions\fR ] \fIpackage\-qualified\-class\-names\fR
.fi
.sp
.TP
\fIoptions\fR
The command-line \f3options\fR\&. See Options\&.
.TP
\fIpackage-qualified-class-names\fR
Class names that include their packages, for example, \f3java\&.awt\&.Color\fR\&.
.SH DESCRIPTION
\fIDeprecation Note:\fR Support for static generation of Java Remote Method Protocol (JRMP) stubs and skeletons has been deprecated\&. Oracle recommends that you use dynamically generated JRMP stubs instead, eliminating the need to use this tool for JRMP-based applications\&. See the \f3java\&.rmi\&.server\&.UnicastRemoteObject\fR specification at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html for further information\&.
.TH "RMIC" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
The \f3rmic\fR compiler generates stub and skeleton class files using the Java Remote Method Protocol (JRMP) and stub and tie class files (IIOP protocol) for remote objects\&. These class files are generated from compiled Java programming language classes that are remote object implementation classes\&. A remote implementation class is a class that implements the interface \f3java\&.rmi\&.Remote\fR\&. The class names in the \f3rmic\fR command must be for classes that were compiled successfully with the \f3javac\fR command and must be fully package qualified\&. For example, running the \f3rmic\fR command on the class file name \f3HelloImpl\fR as shown here creates the \f3HelloImpl_Stub\&.class\fRfile in the hello subdirectory (named for the class\&'s package):
.sp
.nf
\f3rmic hello\&.HelloImpl\fP
.fi
.nf
\f3\fP
.fi
.sp
A skeleton for a remote object is a JRMP protocol server-side entity that has a method that dispatches calls to the remote object implementation\&.
rmic \- generate stub and skeleton class files using the Java Remote
Method Protocol (JRMP)
.SH SYNOPSIS
.PP
A tie for a remote object is a server-side entity similar to a skeleton, but communicates with the client with the IIOP protocol\&.
.PP
A stub is a client-side proxy for a remote object that is responsible for communicating method invocations on remote objects to the server where the actual remote object implementation resides\&. A client\&'s reference to a remote object, therefore, is actually a reference to a local stub\&.
.PP
By default, the \f3rmic\fR command generates stub classes that use the 1\&.2 JRMP stub protocol version only, as though the \f3-v1\&.2\fR option was specified\&. The \f3-vcompat\fR option was the default in releases before 5\&.0\&. Use the \f3-iiop\fR option to generate stub and tie classes for the IIOP protocol\&. See Options\&.
.PP
A stub implements only the remote interfaces, and not any local interfaces that the remote object also implements\&. Because a JRMP stub implements the same set of remote interfaces as the remote object, a client can use the Java programming language built-in operators for casting and type checking\&. For IIOP, the \f3PortableRemoteObject\&.narrow\fR method must be used\&.
.SH OPTIONS
\f[CB]rmic\f[R] [\f[I]options\f[R]]
\f[I]package\-qualified\-class\-names\f[R]
.TP
-bootclasspath \fIpath\fR
.br
Overrides the location of bootstrap class files\&.
.TP
-classpath path
.br
Specifies the path the \f3rmic\fR command uses to look up classes\&. This option overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons\&. The general format for path is: \f3\&.:<your_path>\fR, for example: \f3\&.:/usr/local/java/classes\fR\&.
.TP
-d \fIdirectory\fR
.br
Specifies the root destination directory for the generated class hierarchy\&. You can use this option to specify a destination directory for the stub, skeleton, and tie files\&. For example, the following command places the stub and skeleton classes derived from MyClass into the directory /java/classes/exampleclass\&.
.sp
.nf
\f3rmic \-d /java/classes exampleclass\&.MyClass\fP
.fi
.nf
\f3\fP
.fi
.sp
If the \f3-d\fR option is not specified, then the default behavior is as if \f3-d \&.\fR was specified\&. The package hierarchy of the target class is created in the current directory, and stub/tie/skeleton files are placed within it\&. In some earlier releases of the \f3rmic\fR command, if the \f3-d\fR option was not specified, then the package hierarchy was not created, and all of the output files were placed directly in the current directory\&.
.TP
-extdirs \fIpath\fR
.br
Overrides the location of installed extensions\&.
.TP
-g
.br
Enables the generation of all debugging information, including local variables\&. By default, only line number information is generated\&.
.TP
-idl
.br
Causes the \f3rmic\fR command to generate OMG IDL for the classes specified and any classes referenced\&. IDL provides a purely declarative, programming language-independent way to specify an API for an object\&. The IDL is used as a specification for methods and data that can be written in and called from any language that provides CORBA bindings\&. This includes Java and C++ among others\&. See Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
When the \f3-idl\fR option is used, other options also include:
.RS
.TP 0.2i
\(bu
The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
.TP 0.2i
\(bu
The \f3-factory\fR option uses the \f3factory\fR keyword in generated IDL\&.
.TP 0.2i
\(bu
The \f3-idlModule\fR from J\f3avaPackage[\&.class]\fR\f3toIDLModule\fR specifies \f3IDLEntity\fR package mapping, for example: \f3-idlModule\fR\f3my\&.module my::real::idlmod\fR\&.
.TP 0.2i
\(bu
\f3-idlFile\fR\f3fromJavaPackage[\&.class] toIDLFile\fR specifies \f3IDLEntity\fR file mapping, for example: \f3-idlFile test\&.pkg\&.X TEST16\&.idl\fR\&.
.RE
.TP
-iiop
.br
Causes the \f3rmic\fR command to generate IIOP stub and tie classes, rather than JRMP stub and skeleton classes\&. A stub class is a local proxy for a remote object and is used by clients to send calls to a server\&. Each remote interface requires a stub class, which implements that remote interface\&. A client reference to a remote object is a reference to a stub\&. Tie classes are used on the server side to process incoming calls, and dispatch the calls to the proper implementation class\&. Each implementation class requires a tie class\&.
If you call the \f3rmic\fR command with the \f3-iiop\fR, then it generates stubs and ties that conform to this naming convention:
.sp
.nf
\f3_<implementationName>_stub\&.class\fP
.fi
.nf
\f3_<interfaceName>_tie\&.class\fP
.fi
.nf
\f3\fP
.fi
.sp
.RS
.TP 0.2i
\(bu
When you use the \f3-iiop\fR option, other options also include:
.TP 0.2i
\(bu
The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
.TP 0.2i
\(bu
The \f3-nolocalstubs\fR option means do not create stubs optimized for same-process clients and servers\&.
.TP 0.2i
\(bu
The \f3-noValueMethods\fR option must be used with the \f3-idl\fR option\&. The \f3-noValueMethods\fR option prevents the addition of \f3valuetype\fR methods and initializers to emitted IDL\&. These methods and initializers are optional for valuetypes, and are generated unless the \f3-noValueMethods\fR option is specified with the \f3-idl\fR option\&.
.TP 0.2i
\(bu
The \f3-poa\fR option changes the inheritance from \f3org\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR to \f3org\&.omg\&.PortableServer\&.Servant\fR\&. The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. In the Java programming language, the \f3Servant\fR type is mapped to the \f3Java org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&. Based on the OMG IDL to Java Language Mapping Specification, CORBA V 2\&.3\&.1 ptc/00-01-08\&.pdf\&..RE
.TP
-J
.br
Used with any Java command, the \f3-J\fR option passes the argument that follows the \f3-J\fR (no spaces between the \f3-J\fRand the argument) to the Java interpreter
.TP
-keep or -keepgenerated
.br
Retains the generated \f3\&.java\fR source files for the stub, skeleton, and tie classes and writes them to the same directory as the\f3\&.class\fR files\&.
.TP
-nowarn
.br
Turns off warnings\&. When the \f3-nowarn\fR options is used\&. The compiler does not print out any warnings\&.
.TP
-nowrite
.br
Does not write compiled classes to the file system\&.
.TP
-vcompat (deprecated)
.br
Generates stub and skeleton classes that are compatible with both the 1\&.1 and 1\&.2 JRMP stub protocol versions\&. This option was the default in releases before 5\&.0\&. The generated stub classes use the 1\&.1 stub protocol version when loaded in a JDK 1\&.1 virtual machine and use the 1\&.2 stub protocol version when loaded into a 1\&.2 (or later) virtual machine\&. The generated skeleton classes support both 1\&.1 and 1\&.2 stub protocol versions\&. The generated classes are relatively large to support both modes of operation\&. Note: This option has been deprecated\&. See Description\&.
.TP
-verbose
.br
Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded\&.
.TP
-v1\&.1 (deprecated)
.br
Generates stub and skeleton classes for the 1\&.1 JRMP stub protocol version only\&. The \f3-v1\&.1\fR option is only useful for generating stub classes that are serialization-compatible with preexisting, statically deployed stub classes that were generated by the \f3rmic\fR command from JDK 1\&.1 and that cannot be upgraded (and dynamic class loading is not being used)\&. Note: This option has been deprecated\&. See Description\&.
.TP
-v1\&.2 (deprecated)
.br
(Default) Generates stub classes for the 1\&.2 JRMP stub protocol version only\&. No skeleton classes are generated because skeleton classes are not used with the 1\&.2 stub protocol version\&. The generated stub classes do not work when they are loaded into a JDK 1\&.1 virtual machine\&. Note: This option has been deprecated\&. See Description\&.
.SH ENVIRONMENT\ VARIABLES
.TP
CLASSPATH
Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
javac(1)
.TP 0.2i
\(bu
java(1)
.TP 0.2i
\(bu
Setting the Class Path
.B \f[I]options\f[R]
This represent the command\-line \f[CB]options\f[R] for the\f[CB]rmic\f[R]
compiler.
See \f[B]Options for the rmic Compiler\f[R].
.RS
.RE
.TP
.B \f[I]package\-qualified\-class\-names\f[R]
Class names that include their packages, for example,
\f[CB]java.awt.Color\f[R].
.RS
.RE
.SH DESCRIPTION
.PP
\f[B]Deprecation Note:\f[R] Support for static generation of Java Remote
Method Protocol (JRMP) stubs and skeletons has been deprecated.
Oracle recommends that you use dynamically generated JRMP stubs instead,
eliminating the need to use this tool for JRMP\-based applications.
.PP
The \f[CB]rmic\f[R] compiler generates stub and skeleton class files using
the JRMP.
.PP
\f[B]Note:\f[R]
.PP
The rmic compiler has been updated to remove the \f[CB]\-idl\f[R] and
\f[CB]\-iiop\f[R] options and can no longer generate IDL or IIOP stubs and
tie classes.
.PP
JRMP class files are generated from compiled Java programming language
classes that are remote object implementation classes.
A remote implementation class is a class that implements the interface
\f[CB]java.rmi.Remote\f[R].
The class names in the \f[CB]rmic\f[R] command must be for classes that
were compiled successfully with the \f[CB]javac\f[R] command and must be
fully package qualified.
For example, running the \f[CB]rmic\f[R] command on the class file name
\f[CB]HelloImpl\f[R] as shown here creates the
\f[CB]HelloImpl_Stub.class\f[R] file in the \f[CB]hello\f[R] subdirectory
(named for the class\[aq]s package):
.RS
.PP
\f[CB]rmic\ hello.HelloImpl\f[R]
.RE
.PP
A skeleton for a remote object is a JRMP protocol server\-side entity
that has a method that dispatches calls to the remote object
implementation.
.PP
A stub is a client\-side proxy for a remote object that\[aq]s
responsible for communicating method invocations on remote objects to
the server where the actual remote object implementation resides.
A client\[aq]s reference to a remote object, therefore, is actually a
reference to a local stub.
.PP
By default, the \f[CB]rmic\f[R] command generates stub classes that use
the 1.2 JRMP stub protocol version only, as though the \f[CB]\-v1.2\f[R]
option were specified.
See \f[B]Options for the rmic Compiler\f[R].
.PP
A stub implements only the remote interfaces, and not local interfaces
that the remote object also implements.
Because a JRMP stub implements the same set of remote interfaces as the
remote object, a client can use the Java programming language built\-in
operators for casting and type checking.
.PP
\f[B]Note:\f[R]
.PP
The rmic compiler does not support reading of class files that have been
compiled with the \f[CB]\-\-enable\-preview\f[R] option, nor does it
support generation of stub or skeleton classes that have preview
features enabled.
.SH OPTIONS FOR THE RMIC COMPILER
.TP
.B \f[CB]\-bootclasspath\f[R] \f[I]path\f[R]
Overrides the location of bootstrap class files.
.RS
.RE
.TP
.B \f[CB]\-classpath\f[R] \f[I]path\f[R]
Specifies the path the \f[CB]rmic\f[R] command uses to look up classes.
This option overrides the default or the \f[CB]CLASSPATH\f[R] environment
variable when it is set.
Directories are separated by colons or semicolons, depending on your
operating system.
The following is the general format for \f[I]path\f[R]:
.RS
.IP \[bu] 2
\f[B]Oracle Solaris, Linux, and OS X:\f[R]
\f[CB]\&.:\f[R]\f[I]your_path\f[R], for example:
\f[CB]\&.:/usr/local/java/classes\f[R]
.IP \[bu] 2
\f[B]Windows:\f[R] \f[CB]\&.;\f[R]\f[I]your_path\f[R], for example:
\f[CB]\&.;/usr/local/java/classes\f[R]
.RE
.TP
.B \f[CB]\-d\f[R] \f[I]directory\f[R]
Specifies the root destination directory for the generated class
hierarchy.
You can use this option to specify a destination directory for the stub,
skeleton, and tie files.
.RS
.IP \[bu] 2
\f[B]Oracle Solaris, Linux, and OS X:\f[R] For example, the following
command places the stub and skeleton classes derived from
\f[CB]MyClass\f[R] into the directory \f[CB]/java/classes/exampleclass\f[R]:
.RS 2
.RS
.PP
\f[CB]rmic\ \-d\ /java/classes\ exampleclass.MyClass\f[R]
.RE
.RE
.IP \[bu] 2
\f[B]Windows:\f[R] For example, the following command places the stub and
skeleton classes derived from \f[CB]MyClass\f[R] into the directory
\f[CB]C:\\java\\classes\\exampleclass\f[R]:
.RS 2
.RS
.PP
\f[CB]rmic\ \-d\ C:\\java\\classes\ exampleclass.MyClass\f[R]
.RE
.RE
.PP
If the \f[CB]\-d\f[R] option isn\[aq]t specified, then the default
behavior is as though \f[CB]\-d\f[R] was specified.
The package hierarchy of the target class is created in the current
directory, and stub/tie/skeleton files are placed within it.
.RE
.TP
.B \f[CB]\-g\f[R]
Enables the generation of all debugging information, including local
variables.
By default, only line number information is generated.
.RS
.RE
.TP
.B \f[CB]\-J\f[R]\f[I]argument\f[R]
Used with any Java command, the \f[CB]\-J\f[R] option passes the
\f[I]argument\f[R] that follows it (no spaces between the \f[CB]\-J\f[R]
and the argument) to the Java interpreter.
.RS
.RE
.TP
.B \f[CB]\-keep\f[R] or \f[CB]\-keepgenerated\f[R]
Retains the generated \f[CB]\&.java\f[R] source files for the stub,
skeleton, and tie classes and writes them to the same directory as
the\f[CB]\&.class\f[R] files.
.RS
.RE
.TP
.B \f[CB]\-nowarn\f[R]
Turns off warnings.
When the \f[CB]\-nowarn\f[R] options is used, the compiler doesn\[aq]t
print warnings.
.RS
.RE
.TP
.B \f[CB]\-nowrite\f[R]
Doesn\[aq]t write compiled classes to the file system.
.RS
.RE
.TP
.B \f[CB]\-vcompat\f[R] (deprecated)
Generates stub and skeleton classes that are compatible with both the
1.1 and 1.2 JRMP stub protocol versions.
This option was the default in releases before 5.0.
The generated stub classes use the 1.1 stub protocol version when loaded
in a JDK 1.1 virtual machine and use the 1.2 stub protocol version when
loaded into a 1.2 (or later) virtual machine.
The generated skeleton classes support both 1.1 and 1.2 stub protocol
versions.
The generated classes are relatively large to support both modes of
operation.
.RS
.PP
\f[B]Note:\f[R]
.PP
This option has been deprecated.
See \f[B]Description\f[R].
.RE
.TP
.B \f[CB]\-verbose\f[R]
Causes the compiler and linker to print messages about what classes are
being compiled and what class files are being loaded.
.RS
.RE
.TP
.B \f[CB]\-v1.1\f[R] (deprecated)
Generates stub and skeleton classes for the 1.1 JRMP stub protocol
version only.
The \f[CB]\-v1.1\f[R] option is useful only for generating stub classes
that are serialization\-compatible with existing, statically deployed
stub classes generated by the \f[CB]rmic\f[R] command from JDK 1.1 that
can\[aq]t be upgraded (and dynamic class loading isn\[aq]t being used).
.RS
.PP
\f[B]Note:\f[R]
.PP
This option has been deprecated.
See \f[B]Description\f[R].
.RE
.TP
.B \f[CB]\-v1.2\f[R] (deprecated)
(Default) Generates stub classes for the 1.2 JRMP stub protocol version
only.
No skeleton classes are generated because skeleton classes aren\[aq]t
used with the 1.2 stub protocol version.
The generated stub classes don\[aq]t work when they\[aq]re loaded into a
JDK 1.1 virtual machine.
.RS
.PP
\f[B]Note:\f[R]
.PP
This option has been deprecated.
See \f[B]Description\f[R].
.RE
.SH ENVIRONMENT VARIABLES
.TP
.B \f[CB]CLASSPATH\f[R]
Used to provide the system a path to user\-defined classes.
.RS
.IP \[bu] 2
\f[B]Oracle Solaris, Linux, and OS X:\f[R] Directories are separated by
colons, for example: \f[CB]\&.:/usr/local/java/classes\f[R].
.IP \[bu] 2
\f[B]Windows:\f[R] Directories are separated by colons, for example:
\f[CB]\&.;C:\\usr\\local\\java\\classes\f[R].
.RE
.br
'pl 8.5i
'bp

View File

@ -1,5 +1,4 @@
'\" t
.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -20,228 +19,229 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Title: jjs
.\" Language: English
.\" Date: 03 March 2015
.\" SectDesc: Basic Tools
.\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-04
.\" Doc ID: JSSON
.\" Automatically generated by Pandoc 2.3.1
.\"
.if n .pl 99999
.TH "jjs" "1" "03 March 2015" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
jjs \- Invokes the Nashorn engine\&.
.SH "SYNOPSIS"
.sp
.if n \{\
.RS 4
.\}
.TH "JJS" "1" "2018" "JDK 13" "JDK Commands"
.hy
.SH NAME
.PP
jjs \- command\-line tool to invoke the Nashorn engine
.SH SYNOPSIS
.PP
\f[B]Note:\f[R] The \f[CB]jjs\f[R] tool and the Nashorn engine are
deprecated in JDK 11 in preparation for removal in a future release.
.PP
\f[CB]jjs\f[R] [\f[I]options\f[R]] \f[I]script\-files\f[R] [\f[CB]\-\-\f[R]
\f[I]arguments\f[R]]
.TP
.B \f[I]options\f[R]
This represents one or more options of the \f[CB]jjs\f[R] command,
separated by spaces.
See \f[B]Options for the jjs Command\f[R].
.RS
.RE
.TP
.B \f[I]script\-files\f[R]
This represents one or more script files that you want to interpret
using the Nashorn engine, separated by spaces.
If no files are specified, then an interactive shell is started.
.RS
.RE
.TP
.B \f[I]arguments\f[R]
All values after the double hyphen marker (\f[CB]\-\-\f[R]) are passed
through to the script or the interactive shell as arguments.
These values can be accessed by using the \f[CB]arguments\f[R] property.
.RS
.RE
.SH DESCRIPTION
.PP
The \f[CB]jjs\f[R] command\-line tool is used to invoke the Nashorn
engine.
You can use it to interpret one or several script files, or to run an
interactive shell.
.SH OPTIONS FOR THE JJS COMMAND
.PP
The options of the \f[CB]jjs\f[R] command control the conditions under
which scripts are interpreted by Nashorn engine.
.TP
.B \f[CB]\-D\f[R]\f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R]
Sets a system property to be passed to the script by assigning a value
to a property name.
The following example shows how to invoke Nashorn engine in interactive
mode and assign \f[CB]myValue\f[R] to the property named \f[CB]myKey\f[R]:
.RS
.IP
.nf
\fB\fBjjs\fR\fR\fB [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIscript\-files\fR\fR\fB] [\-\- \fR\fB\fIarguments\fR\fR\fB]\fR
\f[CB]
>>\ jjs\ \-DmyKey=myValue
jjs>\ java.lang.System.getProperty("myKey")
myValue
jjs>
\f[R]
.fi
.if n \{\
.PP
This option can be repeated to set multiple properties.
.RE
.\}
.PP
\fIoptions\fR
.RS 4
One or more options of the
\fBjjs\fR
command, separated by spaces\&. For more information, see Options\&.
.TP
.B \f[CB]\-\-add\-modules\f[R] \f[I]modules\f[R]
Specifies the root user Java modules.
.RS
.RE
.PP
\fIscript\-files\fR
.RS 4
One or more script files which you want to interpret using Nashorn, separated by spaces\&. If no files are specified, an interactive shell is started\&.
.TP
.B \f[CB]\-cp\f[R] \f[I]path\f[R] or \f[CB]\-classpath\f[R] \f[I]path\f[R]
Specifies the path to the supporting class files.
To set multiple paths, the option can be repeated, or you can separate
each path with the following character:
.RS
.IP \[bu] 2
\f[B]Oracle Solaris, Linux, and OS X:\f[R] Colon (\f[CB]:\f[R])
.IP \[bu] 2
\f[B]Windows:\f[R] Semicolon (\f[CB];\f[R])
.RE
.PP
\fIarguments\fR
.RS 4
All values after the double hyphen marker (\fB\-\-\fR) are passed through to the script or the interactive shell as arguments\&. These values can be accessed by using the
\fBarguments\fR
property (see Example 3)\&.
.TP
.B \f[CB]\-doe=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]] or \f[CB]\-dump\-on\-error=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]]
Provides a full stack trace when an error occurs.
By default, only a brief error message is printed.
The default parameter is \f[CB]false\f[R].
.RS
.RE
.SH "DESCRIPTION"
.PP
The
\fBjjs\fR
command\-line tool is used to invoke the Nashorn engine\&. You can use it to interpret one or several script files, or to run an interactive shell\&.
.SH "OPTIONS"
.PP
The options of the
\fBjjs\fR
command control the conditions under which scripts are interpreted by Nashorn\&.
.PP
\-cp \fIpath\fR
.br
\-classpath \fIpath\fR
.RS 4
Specifies the path to the supporting class files To set multiple paths, the option can be repeated, or you can separate each path with a colon (:)\&.
.TP
.B \f[CB]\-fv=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]] or \f[CB]\-fullversion=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]]
Prints the full Nashorn version string.
The default parameter is \f[CB]false\f[R].
.RS
.RE
.TP
.B \f[CB]\-fx=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]]
Launches the script as a JavaFX application.
The default parameter is \f[CB]false\f[R].
.RS
.PP
\-D\fIname\fR=\fIvalue\fR
.RS 4
Sets a system property to be passed to the script by assigning a value to a property name\&. The following example shows how to invoke Nashorn in interactive mode and assign
\fBmyValue\fR
to the property named
\fBmyKey\fR:
.sp
.if n \{\
.RS 4
.\}
\f[B]Note:\f[R]
.PP
You must explicitly add the JavaFX modules to launch the script as a
JavaFX application.
The following example specifies the location of the JavaFX modules and
adds them with the \f[CB]\-\-module\-path\f[R] and
\f[CB]\-\-add\-modules\f[R] options:
.IP
.nf
\fB>> \fR\fB\fBjjs \-DmyKey=myValue\fR\fR
\fBjjs> \fR\fB\fBjava\&.lang\&.System\&.getProperty("myKey")\fR\fR
\fBmyValue\fR
\fBjjs>\fR
\f[CB]
jjs\ \-fx\ \-\-module\-path\ /SOMEDIR/javafx\-sdk\-11/lib\ \-\-add\-modules\ javafx.controls\ HelloWorld.js
\f[R]
.fi
.if n \{\
.RE
.\}
This option can be repeated to set multiple properties\&.
.RE
.PP
\-doe
.br
\-\-dump\-on\-error
.RS 4
Provides a full stack trace when an error occurs\&. By default, only a brief error message is printed\&.
.RE
.PP
\-fv
.br
\-\-fullversion
.RS 4
Prints the full Nashorn version string\&.
.RE
.PP
\-fx
.RS 4
Launches the script as a JavaFX application\&.
.RE
.PP
\-h
.br
\-help
.RS 4
Prints the list of options and their descriptions\&.
.RE
.PP
\-\-language=[es5]
.RS 4
Specifies the ECMAScript language version\&. The default version is ES5\&.
.RE
.PP
\-ot
.br
\-\-optimistic\-types=[true|false]
.RS 4
Enables or disables optimistic type assumptions with deoptimizing recompilation\&. Running with optimistic types will yield higher final speed, but may increase warmup time\&.
.RE
.PP
\-scripting
.RS 4
Enables shell scripting features\&.
.RE
.PP
\-strict
.RS 4
Enables strict mode, which enforces stronger adherence to the standard (ECMAScript Edition 5\&.1), making it easier to detect common coding errors\&.
.RE
.PP
\-t=\fIzone\fR
.br
\-timezone=\fIzone\fR
.RS 4
Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the
\fBDate\fR
object\&.
.RE
.PP
\-v
.br
\-version
.RS 4
Prints the Nashorn version string\&.
.RE
.SH "EXAMPLES"
.PP
\fBExample 1 \fRRunning a Script with Nashorn
.RS 4
.sp
.if n \{\
.RS 4
.\}
The following example uses the \f[CB]jlink\f[R] command to create a custom
runtime image that contains the JavaFX modules.
The example then launches a script as a JavaFX application without
specifying the JavaFX modules in the \f[CB]jjs\f[R] command:
.IP
.nf
\fBjjs script\&.js\fR
\f[CB]
jlink\ \-\-module\-path\ /SOMEDIR/javafx\-jmods\-11\ \-\-add\-modules\ jdk.scripting.nashorn,jdk.scripting.nashorn.shell,javafx.controls\ \-\-output\ /SOMEDIR/myjdk
/SOMEDIR/myjdk/bin/jjs\ \-fx\ HelloWorld.js
\f[R]
.fi
.if n \{\
.RE
.\}
.RE
.PP
\fBExample 2 \fRRunning Nashorn in Interactive Mode
.RS 4
.sp
.if n \{\
.RS 4
.\}
If you don\[aq]t explicitly specify the JavaFX modules, then the
\f[CB]jjs\f[R] command prints a message and exits:
.IP
.nf
\fB>> \fR\fB\fBjjs\fR\fR
\fBjjs> \fR\fB\fBprintln("Hello, World!")\fR\fR
\fBHello, World!\fR
\fBjjs> \fR\fB\fBquit()\fR\fR
\fB>>\fR
\f[CB]
jjs\ \-fx\ HelloWorld.js
JavaFX\ is\ not\ available.
\f[R]
.fi
.if n \{\
.RE
.\}
.TP
.B \f[CB]\-h\f[R] or \f[CB]\-help\f[R]
Prints the list of options and their descriptions.
.RS
.RE
.PP
\fBExample 3 \fRPassing Arguments to Nashorn
.RS 4
.sp
.if n \{\
.RS 4
.\}
.TP
.B \f[CB]\-\-language=\f[R][\f[CB]es5\f[R]|\f[CB]es6\f[R]]
Specifies the ECMAScript language version.
The default version is ES5.
.RS
.RE
.TP
.B \f[CB]\-\-module\-path\f[R] \f[I]path\f[R]
Specifies where to find user Java modules.
.RS
.RE
.TP
.B \f[CB]\-ot=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]] or \f[CB]\-optimistic\-types=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]]
Enables or disables optimistic type assumptions with deoptimizing
recompilation.
This makes the compiler try, for any program symbol whose type can\[aq]t
be proven at compile time, to type it as narrowly and primitively as
possible.
If the runtime encounters an error because the symbol type is too
narrow, then a wider method is generated until a steady stage is
reached.
While this produces as optimal Java bytecode as possible, erroneous type
guesses will lead to longer warmup.
Optimistic typing is currently enabled by default, but it can be
disabled for faster startup performance.
The default parameter is \f[CB]true\f[R].
.RS
.RE
.TP
.B \f[CB]\-scripting=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]]
Enables a shell scripting features.
The default parameter is \f[CB]true\f[R].
.RS
.RE
.TP
.B \f[CB]\-strict=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]]
Enables a strict mode, which enforces stronger adherence to the standard
(ECMAScript Edition 5.1), making it easier to detect common coding
errors.
The default parameter is \f[CB]false\f[R].
.RS
.RE
.TP
.B \f[CB]\-t=\f[R]\f[I]zone\f[R] or \f[CB]\-timezone=\f[R]\f[I]zone\f[R]
Sets the specified time zone for script execution.
It overrides the time zone set in the OS and used by the \f[CB]Date\f[R]
object.
The default \f[I]zone\f[R] is \f[CB]America/Los_Angeles\f[R].
.RS
.RE
.TP
.B \f[CB]\-v=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]] or\f[CB]\-version=\f[R][\f[CB]true\f[R]|\f[CB]false\f[R]]
Prints the Nashorn version string.
The default parameter is \f[CB]false\f[R].
.RS
.RE
.SH EXAMPLE OF RUNNING A SCRIPT WITH NASHORN
.IP
.nf
\fB>> \fR\fB\fBjjs \-\- a b c\fR\fR
\fBjjs> \fR\fB\fBarguments\&.join(", ")\fR\fR
\fBa, b, c\fR
\fBjjs>\fR
\f[CB]
jjs\ script.js
\f[R]
.fi
.SH EXAMPLE OF RUNNING NASHORN IN INTERACTIVE MODE
.IP
.nf
\f[CB]
>>\ jjs
jjs>\ println("Hello,\ World!")
Hello,\ World!
jjs>\ quit()
>>
\f[R]
.fi
.SH EXAMPLE OF PASSING ARGUMENTS TO NASHORN
.IP
.nf
\f[CB]
>>\ jjs\ \-\-\ a\ b\ c
jjs>\ arguments.join(",\ ")
a,\ b,\ c
jjs>
\f[R]
.fi
.if n \{\
.RE
.\}
.RE
.SH "SEE ALSO"
.PP
\fBjrunscript\fR
.br
'pl 8.5i
'bp