src/jdk.compiler/share/man/javac.1
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 55666 340d73f42b3c
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
     1
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     2
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     3
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     4
.\" This code is free software; you can redistribute it and/or modify it
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     5
.\" under the terms of the GNU General Public License version 2 only, as
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     6
.\" published by the Free Software Foundation.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     7
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     8
.\" This code is distributed in the hope that it will be useful, but WITHOUT
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     9
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    10
.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    11
.\" version 2 for more details (a copy is included in the LICENSE file that
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    12
.\" accompanied this code).
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    13
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    14
.\" You should have received a copy of the GNU General Public License version
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    15
.\" 2 along with this work; if not, write to the Free Software Foundation,
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    16
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    17
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    18
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    19
.\" or visit www.oracle.com if you need additional information or have any
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    20
.\" questions.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    21
.\"
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    22
.\" Automatically generated by Pandoc 2.3.1
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
    23
.\"
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    24
.TH "JAVAC" "1" "2019" "JDK 13" "JDK Commands"
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    25
.hy
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    26
.SH NAME
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    27
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    28
javac \- read Java declarations and compile them into class files
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    29
.SH SYNOPSIS
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
    30
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    31
\f[CB]javac\f[R] [\f[I]options\f[R]] [\f[I]sourcefiles\-or\-classnames\f[R]]
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
    32
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    33
.B \f[I]options\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    34
Command\-line options.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    35
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    36
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
    37
.TP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    38
.B \f[I]sourcefiles\-or\-classnames\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    39
Source files to be compiled (for example, \f[CB]Shape.java\f[R]) or the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    40
names of previously compiled classes to be processed for annotations
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    41
(for example, \f[CB]geometry.MyShape\f[R]).
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    42
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    43
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    44
.SH DESCRIPTION
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    45
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    46
The \f[CB]javac\f[R] command reads \f[I]source files\f[R] that contain
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    47
module, package and type declarations written in the Java programming
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    48
language, and compiles them into \f[I]class files\f[R] that run on the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    49
Java Virtual Machine.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    50
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    51
The \f[CB]javac\f[R] command can also \f[B]process annotations\f[R] in Java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    52
source files and classes.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    53
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    54
Source files must have a file name extension of \f[CB]\&.java\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    55
Class files have a file name extension of \f[CB]\&.class\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    56
Both source and class files normally have file names that identify the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    57
contents.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    58
For example, a class called \f[CB]Shape\f[R] would be declared in a source
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    59
file called \f[CB]Shape.java\f[R], and compiled into a class file called
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    60
\f[CB]Shape.class\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    61
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    62
There are two ways to specify source files to \f[CB]javac\f[R]:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    63
.IP \[bu] 2
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    64
For a small number of source files, you can list their file names on the
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    65
command line.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    66
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    67
For a large number of source files, you can use the
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    68
\f[CB]\@\f[R]\f[I]filename\f[R] option on the command line to specify an
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    69
\f[I]argument file\f[R] that lists their file names.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    70
See \f[B]Standard Options\f[R] for a description of the option and
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    71
\f[B]Command\-Line Argument Files\f[R] for a description of
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    72
\f[CB]javac\f[R] argument files.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    73
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    74
The order of source files specified on the command line or in an
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    75
argument file is not important.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    76
\f[CB]javac\f[R] will compile the files together, as a group, and will
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    77
automatically resolve any dependencies between the declarations in the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    78
various source files.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    79
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    80
\f[CB]javac\f[R] expects that source files are arranged in one or more
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    81
directory hierarchies on the file system, described in \f[B]Arrangement
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    82
of Source Code\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    83
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    84
To compile a source file, \f[CB]javac\f[R] needs to find the declaration
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    85
of every class or interface that is used, extended, or implemented by
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    86
the code in the source file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    87
This lets \f[CB]javac\f[R] check that the code has the right to access
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    88
those classes and interfaces.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    89
Rather than specifying the source files of those classes and interfaces
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    90
explicitly, you can use command\-line options to tell \f[CB]javac\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    91
where to search for their source files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    92
If you have compiled those source files previously, you can use options
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    93
to tell \f[CB]javac\f[R] where to search for the corresponding class
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    94
files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    95
The options, which all have names ending in "path", are described in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    96
\f[B]Standard Options\f[R], and further described in \f[B]Configuring a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    97
Compilation\f[R] and \f[B]Searching for Module, Package and Type
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
    98
Declarations\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    99
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   100
By default, \f[CB]javac\f[R] compiles each source file to a class file in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   101
the same directory as the source file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   102
However, it is recommended to specify a separate destination directory
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   103
with the \f[CB]\-d\f[R] option described in \f[B]Standard Options\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   104
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   105
Command\-line \f[B]options\f[R] and \f[B]environment variables\f[R] also
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   106
control how \f[CB]javac\f[R] performs various tasks:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   107
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   108
Compiling code to run on earlier releases of the JDK.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   109
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   110
Compiling code to run under a debugger.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   111
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   112
Checking for stylistic issues in Java source code.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   113
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   114
Checking for problems in \f[CB]javadoc\f[R] comments
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   115
(\f[CB]/**\ ...\ */\f[R]).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   116
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   117
Processing annotations in source files and class files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   118
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   119
Upgrading and patching modules in the compile\-time environment.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   120
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   121
\f[CB]javac\f[R] supports \f[B]Compiling for Earlier Releases Of The
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   122
Platform\f[R] and can also be invoked from Java code using one of a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   123
number of \f[B]APIs\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   124
.SH OPTIONS
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   125
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   126
\f[CB]javac\f[R] provides \f[B]standard options\f[R], and \f[B]extra
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   127
options\f[R] that are either non\-standard or are for advanced use.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   128
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   129
Some options take one or more arguments.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   130
If an argument contains spaces or other whitespace characters, the value
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   131
should be quoted according to the conventions of the environment being
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   132
used to invoke javac.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   133
If the option begins with a single dash (\f[CB]\-\f[R]) the argument
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   134
should either directly follow the option name, or should be separated
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   135
with a colon (\f[CB]:\f[R]) or whitespace, depending on the option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   136
If the option begins with a double dash (\f[CB]\-\-\f[R]), the argument
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   137
may be separated either by whitespace or by an equals (\f[CB]=\f[R])
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   138
character with no additional whitespace.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   139
For example,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   140
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   141
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   142
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   143
\-Aname="J.\ Duke"
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   144
\-proc:only
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   145
\-d\ myDirectory
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   146
\-\-module\-version\ 3
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   147
\-\-module\-version=3
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   148
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   149
.fi
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   150
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   151
In the following lists of options, an argument of \f[I]path\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   152
represents a search path, composed of a list of file system locations
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   153
separated by the platform path separator character, (semicolon
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   154
\f[CB];\f[R] on Windows, or colon \f[CB]:\f[R] on other systems.) Depending
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   155
on the option, the file system locations may be directories, JAR files
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   156
or JMOD files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   157
.SS Standard Options
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   158
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   159
.B \f[CB]\@\f[R]\f[I]filename\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   160
Reads options and file names from a file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   161
To shorten or simplify the \f[CB]javac\f[R] command, you can specify one
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   162
or more files that contain arguments to the \f[CB]javac\f[R] command
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   163
(except \f[CB]\-J\f[R] options).
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   164
This lets you to create \f[CB]javac\f[R] commands of any length on any
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   165
operating system.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   166
See \f[B]Command\-Line Argument Files\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   167
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   168
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   169
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   170
.B \f[CB]\-A\f[R]\f[I]key\f[R][\f[CB]=\f[R]\f[I]value\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   171
Specifies options to pass to annotation processors.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   172
These options are not interpreted by \f[CB]javac\f[R] directly, but are
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   173
made available for use by individual processors.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   174
The \f[I]key\f[R] value should be one or more identifiers separated by a
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   175
dot (\f[CB]\&.\f[R]).
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   176
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   177
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   178
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   179
.B \f[CB]\-\-add\-modules\f[R] \f[I]module\f[R]\f[CB],\f[R]\f[I]module\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   180
Specifies root modules to resolve in addition to the initial modules, or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   181
all modules on the module path if \f[I]module\f[R] is
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   182
\f[CB]ALL\-MODULE\-PATH.\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   183
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   184
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   185
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   186
.B \f[CB]\-\-boot\-class\-path\f[R] \f[I]path\f[R] or \f[CB]\-bootclasspath\f[R] \f[I]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   187
Overrides the location of the bootstrap class files.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   188
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   189
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   190
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   191
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   192
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   193
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   194
For JDK 9 or later, see \f[CB]\-\-system\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   195
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   196
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   197
.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]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   198
Specifies where to find user class files and annotation processors.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   199
This class path overrides the user class path in the \f[CB]CLASSPATH\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   200
environment variable.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   201
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   202
.IP \[bu] 2
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   203
If \f[CB]\-\-class\-path\f[R], \f[CB]\-classpath\f[R], or \f[CB]\-cp\f[R] are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   204
not specified, then the user class path is the value of the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   205
\f[CB]CLASSPATH\f[R] environment variable, if that is set, or else the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   206
current directory.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   207
.IP \[bu] 2
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   208
If not compiling code for modules, if the \f[CB]\-\-source\-path\f[R] or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   209
\-sourcepath` option is not specified, then the user class path is also
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   210
searched for source files.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   211
.IP \[bu] 2
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   212
If the \f[CB]\-processorpath\f[R] option is not specified, then the class
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   213
path is also searched for annotation processors.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   214
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   215
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   216
.B \f[CB]\-d\f[R] \f[I]directory\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   217
Sets the destination directory (or \f[I]class output directory\f[R]) for
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   218
class files.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   219
If a class is part of a package, then \f[CB]javac\f[R] puts the class file
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   220
in a subdirectory that reflects the module name (if appropriate) and
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   221
package name.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   222
The directory, and any necessary subdirectories, will be created if they
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   223
do not already exist.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   224
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   225
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   226
If the \f[CB]\-d\f[R] option is not specified, then \f[CB]javac\f[R] puts
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   227
each class file in the same directory as the source file from which it
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   228
was generated.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   229
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   230
Except when compiling code for multiple modules, the contents of the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   231
class output directory will be organized in a package hierarchy.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   232
When compiling code for multiple modules, the contents of the output
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   233
directory will be organized in a module hierarchy, with the contents of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   234
each module in a separate subdirectory, each organized as a package
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   235
hierarchy.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   236
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   237
\f[B]Note:\f[R] When compiling code for one or more modules, the class
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   238
output directory will automatically be checked when searching for
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   239
previously compiled classes.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   240
When not compiling for modules, for backwards compatibility, the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   241
directory is \f[I]not\f[R] automatically checked for previously compiled
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   242
classes, and so it is recommended to specify the class output directory
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   243
as one of the locations on the user class path, using the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   244
\f[CB]\-\-class\-path\f[R] option or one of its alternate forms.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   245
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   246
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   247
.B \f[CB]\-deprecation\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   248
Shows a description of each use or override of a deprecated member or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   249
class.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   250
Without the \f[CB]\-deprecation\f[R] option, \f[CB]javac\f[R] shows a
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   251
summary of the source files that use or override deprecated members or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   252
classes.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   253
The \f[CB]\-deprecation\f[R] option is shorthand for
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   254
\f[CB]\-Xlint:deprecation\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   255
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   256
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   257
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   258
.B \f[CB]\-\-enable\-preview\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   259
Enables preview language features.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   260
Used in conjunction with either \f[CB]\-source\f[R] or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   261
\f[CB]\-\-release\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   262
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   263
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   264
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   265
.B \f[CB]\-encoding\f[R] \f[I]encoding\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   266
Specifies character encoding used by source files, such as EUC\-JP and
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   267
UTF\-8.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   268
If the \f[CB]\-encoding\f[R] option is not specified, then the platform
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   269
default converter is used.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   270
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   271
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   272
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   273
.B \f[CB]\-endorseddirs\f[R] \f[I]directories\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   274
Overrides the location of the endorsed standards path.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   275
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   276
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   277
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   278
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   279
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   280
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   281
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   282
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   283
.B \f[CB]\-extdirs\f[R] \f[I]directories\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   284
Overrides the location of the installed extensions.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   285
\f[CB]directories\f[R] is a list of directories, separated by the platform
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   286
path separator (\f[CB];\f[R] on Windows, and \f[CB]:\f[R] otherwise).
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   287
Each JAR file in the specified directories is searched for class files.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   288
All JAR files found become part of the class path.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   289
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   290
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   291
If you are compiling for a release of the platform that supports the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   292
Extension Mechanism, then this option specifies the directories that
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   293
contain the extension classes.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   294
See [Compiling for Other Releases of the Platform].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   295
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   296
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   297
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   298
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   299
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   300
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   301
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   302
.B \f[CB]\-g\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   303
Generates all debugging information, including local variables.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   304
By default, only line number and source file information is generated.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   305
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   306
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   307
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   308
.B \f[CB]\-g:\f[R][\f[CB]lines\f[R], \f[CB]vars\f[R], \f[CB]source\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   309
Generates only the kinds of debugging information specified by the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   310
comma\-separated list of keywords.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   311
Valid keywords are:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   312
.RS
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   313
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   314
.B \f[CB]lines\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   315
Line number debugging information.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   316
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   317
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   318
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   319
.B \f[CB]vars\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   320
Local variable debugging information.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   321
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   322
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   323
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   324
.B \f[CB]source\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   325
Source file debugging information.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   326
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   327
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   328
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   329
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   330
.B \f[CB]\-g:none\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   331
Does not generate debugging information.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   332
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   333
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   334
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   335
.B \f[CB]\-h\f[R] \f[I]directory\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   336
Specifies where to place generated native header files.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   337
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   338
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   339
When you specify this option, a native header file is generated for each
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   340
class that contains native methods or that has one or more constants
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   341
annotated with the \f[B]\f[BC]java.lang.annotation.Native\f[B]\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   342
annotation.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   343
If the class is part of a package, then the compiler puts the native
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   344
header file in a subdirectory that reflects the module name (if
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   345
appropriate) and package name.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   346
The directory, and any necessary subdirectories, will be created if they
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   347
do not already exist.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   348
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   349
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   350
.B \f[CB]\-\-help\f[R], \f[CB]\-help\f[R] or \f[CB]\-?\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   351
Prints a synopsis of the standard options.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   352
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   353
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   354
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   355
.B \f[CB]\-\-help\-extra\f[R] or \f[CB]\-X\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   356
Prints a synopsis of the set of extra options.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   357
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   358
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   359
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   360
.B \f[CB]\-implicit:\f[R][\f[CB]none\f[R], \f[CB]class\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   361
Specifies whether or not to generate class files for implicitly
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   362
referenced files:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   363
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   364
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   365
\f[CB]\-implicit:class\f[R] \-\-\- Automatically generates class files.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   366
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   367
\f[CB]\-implicit:none\f[R] \-\-\- Suppresses class file generation.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   368
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   369
If this option is not specified, then the default automatically
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   370
generates class files.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   371
In this case, the compiler issues a warning if any class files are
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   372
generated when also doing annotation processing.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   373
The warning is not issued when the \f[CB]\-implicit\f[R] option is
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   374
explicitly set.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   375
See \f[B]Searching for Module, Package and Type Declarations\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   376
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   377
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   378
.B \f[CB]\-J\f[R]\f[I]option\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   379
Passes \f[I]option\f[R] to the runtime system, where \f[I]option\f[R] is
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   380
one of the Java options described on \f[B]java\f[R] command.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   381
For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   382
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   383
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   384
\f[B]Note:\f[R] The \f[CB]CLASSPATH\f[R] environment variable,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   385
\f[CB]\-classpath\f[R] option, \f[CB]\-bootclasspath\f[R] option, and
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   386
\f[CB]\-extdirs\f[R] option do not specify the classes used to run
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   387
\f[CB]javac\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   388
Trying to customize the compiler implementation with these options and
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   389
variables is risky and often does not accomplish what you want.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   390
If you must customize the compiler implementation, then use the
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   391
\f[CB]\-J\f[R] option to pass options through to the underlying Java
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   392
launcher.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   393
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   394
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   395
.B \f[CB]\-\-limit\-modules\f[R] \f[I]module\f[R]\f[CB],\f[R]\f[I]module\f[R]*
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   396
Limits the universe of observable modules.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   397
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   398
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   399
.TP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   400
.B \f[CB]\-\-module\f[R] \f[I]module\-name\f[R] (\f[CB],\f[R]\f[I]module\-name\f[R])* or \f[CB]\-m\f[R] \f[I]module\-name\f[R] (\f[CB],\f[R]\f[I]module\-name\f[R])*
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   401
Compiles those source files in the named modules that are newer than the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   402
corresponding files in the output directory.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   403
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   404
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   405
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   406
.B \f[CB]\-\-module\-path\f[R] \f[I]path\f[R] or \f[CB]\-p\f[R] \f[I]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   407
Specifies where to find application modules.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   408
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   409
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   410
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   411
.B \f[CB]\-\-module\-source\-path\f[R] \f[I]module\-source\-path\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   412
Specifies where to find source files when compiling code in multiple
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   413
modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   414
See [Compilation Modes] and \f[B]The Module Source Path Option\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   415
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   416
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   417
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   418
.B \f[CB]\-\-module\-version\f[R] \f[I]version\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   419
Specifies the version of modules that are being compiled.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   420
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   421
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   422
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   423
.B \f[CB]\-nowarn\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   424
Disables warning messages.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   425
This option operates the same as the \f[CB]\-Xlint:none\f[R] option.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   426
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   427
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   428
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   429
.B \f[CB]\-parameters\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   430
Generates metadata for reflection on method parameters.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   431
Stores formal parameter names of constructors and methods in the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   432
generated class file so that the method
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   433
\f[CB]java.lang.reflect.Executable.getParameters\f[R] from the Reflection
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   434
API can retrieve them.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   435
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   436
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   437
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   438
.B \f[CB]\-proc:\f[R][\f[CB]none\f[R], \f[CB]only\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   439
Controls whether annotation processing and compilation are done.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   440
\f[CB]\-proc:none\f[R] means that compilation takes place without
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   441
annotation processing.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   442
\f[CB]\-proc:only\f[R] means that only annotation processing is done,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   443
without any subsequent compilation.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   444
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   445
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   446
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   447
.B \f[CB]\-processor\f[R] \f[I]class1\f[R][\f[CB],\f[R]\f[I]class2\f[R]\f[CB],\f[R]\f[I]class3\f[R]...]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   448
Names of the annotation processors to run.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   449
This bypasses the default discovery process.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   450
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   451
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   452
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   453
.B \f[CB]\-\-processor\-module\-path\f[R] \f[I]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   454
Specifies the module path used for finding annotation processors.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   455
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   456
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   457
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   458
.B \f[CB]\-\-processor\-path\f[R] \f[I]path\f[R] or \f[CB]\-processorpath\f[R] \f[I]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   459
Specifies where to find annotation processors.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   460
If this option is not used, then the class path is searched for
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   461
processors.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   462
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   463
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   464
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   465
.B \f[CB]\-profile\f[R] \f[I]profile\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   466
Checks that the API used is available in the specified profile.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   467
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   468
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   469
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   470
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   471
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   472
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   473
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   474
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   475
.B \f[CB]\-\-release\f[R] \f[I]release\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   476
Compiles source code according to the rules of the Java programming
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   477
language for the specified Java SE release, generating class files which
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   478
target that release.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   479
Source code is compiled against the combined Java SE and JDK API for the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   480
specified release.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   481
.RS
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   482
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   483
The supported values of \f[I]release\f[R] are the current Java SE release
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   484
and a limited number of previous releases, detailed in the command\-line
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   485
help.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   486
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   487
For the current release, the Java SE API consists of the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   488
\f[CB]java.*\f[R], \f[CB]javax.*\f[R], and \f[CB]org.*\f[R] packages that are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   489
exported by the Java SE modules in the release; the JDK API consists of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   490
the \f[CB]com.*\f[R] and \f[CB]jdk.*\f[R] packages that are exported by the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   491
JDK modules in the release, plus the \f[CB]javax.*\f[R] packages that are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   492
exported by standard, but non\-Java SE, modules in the release.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   493
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   494
For previous releases, the Java SE API and the JDK API are as defined in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   495
that release.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   496
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   497
\f[B]Note:\f[R] When using \f[CB]\-\-release\f[R], you cannot also use the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   498
\f[CB]\-\-source\f[R]/\f[CB]\-source\f[R] or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   499
\f[CB]\-\-target\f[R]/\f[CB]\-target\f[R] options.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   500
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   501
\f[B]Note:\f[R] When using \f[CB]\-\-release\f[R] to specify a release that
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   502
supports the Java Platform Module System, the \f[CB]\-\-add\-exports\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   503
option cannot be used to enlarge the set of packages exported by the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   504
Java SE, JDK, and standard modules in the specified release.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   505
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   506
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   507
.B \f[CB]\-s\f[R] \f[I]directory\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   508
Specifies the directory used to place the generated source files.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   509
If a class is part of a package, then the compiler puts the source file
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   510
in a subdirectory that reflects the module name (if appropriate) and
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   511
package name.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   512
The directory, and any necessary subdirectories, will be created if they
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   513
do not already exist.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   514
.RS
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   515
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   516
Except when compiling code for multiple modules, the contents of the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   517
source output directory will be organized in a package hierarchy.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   518
When compiling code for multiple modules, the contents of the source
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   519
output directory will be organized in a module hierarchy, with the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   520
contents of each module in a separate subdirectory, each organized as a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   521
package hierarchy.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   522
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   523
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   524
.B \f[CB]\-\-source\f[R] \f[I]release\f[R] or \f[CB]\-source\f[R] \f[I]release\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   525
Compiles source code according to the rules of the Java programming
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   526
language for the specified Java SE release.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   527
The supported values of \f[I]release\f[R] are the current Java SE release
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   528
and a limited number of previous releases, detailed in the command\-line
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   529
help.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   530
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   531
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   532
If the option is not specified, the default is to compile source code
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   533
according to the rules of the Java programming language for the current
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   534
Java SE release.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   535
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   536
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   537
.B \f[CB]\-\-source\-path\f[R] \f[I]path\f[R] or \f[CB]\-sourcepath\f[R] \f[I]path\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   538
Specifies where to find source files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   539
Except when compiling multiple modules together, this is the source code
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   540
path used to search for class or interface definitions.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   541
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   542
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   543
\f[B]Note:\f[R] Classes found through the class path might be recompiled
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   544
when their source files are also found.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   545
See \f[B]Searching for Module, Package and Type Declarations\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   546
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   547
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   548
.B \f[CB]\-\-system\f[R] \f[I]jdk\f[R] | \f[CB]none\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   549
Overrides the location of system modules.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   550
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   551
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   552
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   553
.B \f[CB]\-\-target\f[R] \f[I]release\f[R] or \f[CB]\-target\f[R] \f[I]release\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   554
Generates \f[CB]class\f[R] files suitable for the specified Java SE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   555
release.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   556
The supported values of \f[I]release\f[R] are the current Java SE release
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   557
and a limited number of previous releases, detailed in the command\-line
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   558
help.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   559
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   560
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   561
\f[B]Note:\f[R] The target release must be equal to or higher than the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   562
source release.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   563
(See \f[CB]\-\-source\f[R].)
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   564
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   565
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   566
.B \f[CB]\-\-upgrade\-module\-path\f[R] \f[I]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   567
Overrides the location of upgradeable modules.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   568
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   569
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   570
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   571
.B \f[CB]\-verbose\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   572
Outputs messages about what the compiler is doing.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   573
Messages include information about each class loaded and each source
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   574
file compiled.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   575
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   576
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   577
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   578
.B \f[CB]\-\-version\f[R] or \f[CB]\-version\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   579
Prints version information.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   580
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   581
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   582
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   583
.B \f[CB]\-Werror\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   584
Terminates compilation when warnings occur.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   585
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   586
.RE
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   587
.SS Extra Options
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   588
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   589
.B \f[CB]\-\-add\-exports\f[R] \f[I]module\f[R]\f[CB]/\f[R]\f[I]package\f[R]\f[CB]=\f[R]\f[I]other\-module\f[R](\f[CB],\f[R]\f[I]other\-module\f[R])*
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   590
Specifies a package to be considered as exported from its defining
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   591
module to additional modules or to all unnamed modules when the value of
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   592
\f[I]other\-module\f[R] is \f[CB]ALL\-UNNAMED\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   593
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   594
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   595
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   596
.B \f[CB]\-\-add\-reads\f[R] \f[I]module\f[R]\f[CB]=\f[R]\f[I]other\-module\f[R](\f[CB],\f[R]\f[I]other\-module\f[R])*
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   597
Specifies additional modules to be considered as required by a given
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   598
module.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   599
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   600
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   601
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   602
.B \f[CB]\-\-default\-module\-for\-created\-files\f[R] \f[I]module\-name\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   603
Specifies the fallback target module for files created by annotation
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   604
processors, if none is specified or inferred.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   605
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   606
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   607
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   608
.B \f[CB]\-Djava.endorsed.dirs=\f[R]\f[I]dirs\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   609
Overrides the location of the endorsed standards path.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   610
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   611
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   612
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   613
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   614
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   615
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   616
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   617
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   618
.B \f[CB]\-Djava.ext.dirs=\f[R]\f[I]dirs\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   619
Overrides the location of installed extensions.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   620
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   621
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   622
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   623
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   624
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   625
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   626
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   627
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   628
.B \f[CB]\-\-doclint\-format\f[R] [\f[CB]html4\f[R]|\f[CB]html5\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   629
Specifies the format for documentation comments.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   630
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   631
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   632
.TP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   633
.B \f[CB]\-\-patch\-module\f[R] \f[I]module\f[R]\f[CB]=\f[R]\f[I]path\f[R]
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   634
Overrides or augments a module with classes and resources in JAR files
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   635
or directories.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   636
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   637
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   638
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   639
.B \f[CB]\-Xbootclasspath:\f[R]\f[I]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   640
Overrides the location of the bootstrap class files.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   641
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   642
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   643
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   644
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   645
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   646
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   647
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   648
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   649
.B \f[CB]\-Xbootclasspath/a:\f[R]\f[I]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   650
Adds a suffix to the bootstrap class path.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   651
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   652
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   653
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   654
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   655
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   656
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   657
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   658
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   659
.B \f[CB]\-Xbootclasspath/p:\f[R]\f[I]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   660
Adds a prefix to the bootstrap class path.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   661
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   662
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   663
\f[B]Note:\f[R] This can only be used when compiling for releases prior
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   664
to JDK 9.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   665
As applicable, see the descriptions in \f[CB]\-\-release\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   666
\f[CB]\-source\f[R], or \f[CB]\-target\f[R] for details.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   667
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   668
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   669
.B \f[CB]\-Xdiags:\f[R][\f[CB]compact\f[R], \f[CB]verbose\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   670
Selects a diagnostic mode.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   671
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   672
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   673
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   674
.B \f[CB]\-Xdoclint\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   675
Enables recommended checks for problems in \f[CB]javadoc\f[R] comments
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   676
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   677
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   678
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   679
.B \f[CB]\-Xdoclint:\f[R](\f[CB]all\f[R]|\f[CB]none\f[R]|[\f[CB]\-\f[R]]\f[I]group\f[R])[\f[CB]/\f[R]\f[I]access\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   680
Enables or disables specific groups of checks,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   681
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   682
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   683
\f[I]group\f[R] can have one of the following values:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   684
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   685
\f[CB]accessibility\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   686
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   687
\f[CB]html\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   688
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   689
\f[CB]missing\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   690
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   691
\f[CB]reference\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   692
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   693
\f[CB]syntax\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   694
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   695
The variable \f[I]access\f[R] specifies the minimum visibility level of
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   696
classes and members that the \f[CB]\-Xdoclint\f[R] option checks.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   697
It can have one of the following values (in order of most to least
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   698
visible):
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   699
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   700
\f[CB]public\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   701
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   702
\f[CB]protected\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   703
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   704
\f[CB]package\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   705
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   706
\f[CB]private\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   707
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   708
The default \f[I]access\f[R] level is \f[CB]private\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   709
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   710
For more information about these groups of checks, see the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   711
\f[CB]\-Xdoclint\f[R] option of the \f[CB]javadoc\f[R] command.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   712
The \f[CB]\-Xdoclint\f[R] option is disabled by default in the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   713
\f[CB]javac\f[R] command.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   714
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   715
For example, the following option checks classes and members (with all
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   716
groups of checks) that have the access level of protected and higher
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   717
(which includes protected and public):
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   718
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   719
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   720
\f[CB]\-Xdoclint:all/protected\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   721
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   722
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   723
The following option enables all groups of checks for all access levels,
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   724
except it will not check for HTML errors for classes and members that
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   725
have the access level of package and higher (which includes package,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   726
protected and public):
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   727
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   728
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   729
\f[CB]\-Xdoclint:all,\-html/package\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   730
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   731
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   732
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   733
.B \f[CB]\-Xdoclint/package:\f[R][\f[CB]\-\f[R]]\f[I]packages\f[R](\f[CB],\f[R][\f[CB]\-\f[R]]\f[I]package\f[R])*
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   734
Enables or disables checks in specific packages.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   735
Each \f[I]package\f[R] is either the qualified name of a package or a
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   736
package name prefix followed by \f[CB]\&.*\f[R], which expands to all
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   737
sub\-packages of the given package.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   738
Each \f[I]package\f[R] can be prefixed with a hyphen (\f[CB]\-\f[R]) to
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   739
disable checks for a specified package or packages.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   740
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   741
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   742
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   743
.B \f[CB]\-Xlint\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   744
Enables all recommended warnings.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   745
In this release, enabling all available warnings is recommended.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   746
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   747
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   748
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   749
.B \f[CB]\-Xlint:\f[R][\f[CB]\-\f[R]]\f[I]key\f[R](\f[CB],\f[R][\f[CB]\-\f[R]]\f[I]key\f[R])*
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   750
Supplies warnings to enable or disable, separated by comma.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   751
Precede a key by a hyphen (\f[CB]\-\f[R]) to disable the specified
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   752
warning.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   753
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   754
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   755
Supported values for \f[I]key\f[R] are:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   756
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   757
\f[CB]all\f[R]: Enables all warnings.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   758
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   759
\f[CB]auxiliaryclass\f[R]: Warns about an auxiliary class that\[aq]s
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   760
hidden in a source file, and is used from other files.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   761
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   762
\f[CB]cast\f[R]: Warns about the use of unnecessary casts.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   763
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   764
\f[CB]classfile\f[R]: Warns about the issues related to classfile
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   765
contents.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   766
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   767
\f[CB]deprecation\f[R]: Warns about the use of deprecated items.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   768
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   769
\f[CB]dep\-ann\f[R]: Warns about the items marked as deprecated in
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   770
\f[CB]javadoc\f[R] but without the \f[CB]\@Deprecated\f[R] annotation.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   771
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   772
\f[CB]divzero\f[R]: Warns about the division by the constant integer 0.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   773
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   774
\f[CB]empty\f[R]: Warns about an empty statement after \f[CB]if\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   775
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   776
\f[CB]exports\f[R]: Warns about the issues regarding module exports.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   777
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   778
\f[CB]fallthrough\f[R]: Warns about the falling through from one case of a
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   779
switch statement to the next.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   780
.IP \[bu] 2
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   781
\f[CB]finally\f[R]: Warns about \f[CB]finally\f[R] clauses that do not
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   782
terminate normally.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   783
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   784
\f[CB]module\f[R]: Warns about the module system\-related issues.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   785
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   786
\f[CB]opens\f[R]: Warns about the issues related to module opens.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   787
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   788
\f[CB]options\f[R]: Warns about the issues relating to use of command line
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   789
options.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   790
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   791
\f[CB]overloads\f[R]: Warns about the issues related to method overloads.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   792
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   793
\f[CB]overrides\f[R]: Warns about the issues related to method overrides.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   794
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   795
\f[CB]path\f[R]: Warns about the invalid path elements on the command l
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   796
ine.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   797
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   798
\f[CB]processing\f[R]: Warns about the issues related to annotation
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   799
processing.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   800
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   801
\f[CB]rawtypes\f[R]: Warns about the use of raw types.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   802
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   803
\f[CB]removal\f[R]: Warns about the use of an API that has been marked for
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   804
removal.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   805
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   806
\f[CB]requires\-automatic\f[R]: Warns developers about the use of
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   807
automatic modules in requires clauses.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   808
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   809
\f[CB]requires\-transitive\-automatic\f[R]: Warns about automatic modules
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   810
in requires transitive.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   811
.IP \[bu] 2
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   812
\f[CB]serial\f[R]: Warns about the serializable classes that do not
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   813
provide a serial version ID.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   814
Also warns about access to non\-public members from a serializable
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   815
element.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   816
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   817
\f[CB]static\f[R]: Warns about the accessing a static member using an
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   818
instance.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   819
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   820
\f[CB]try\f[R]: Warns about the issues relating to the use of try blocks (
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   821
that is, try\-with\-resources).
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   822
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   823
\f[CB]unchecked\f[R]: Warns about the unchecked operations.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   824
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   825
\f[CB]varargs\f[R]: Warns about the potentially unsafe \f[CB]vararg\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   826
methods.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   827
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   828
\f[CB]none\f[R]: Disables all warnings.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   829
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   830
See \f[B]Examples of Using \-Xlint keys\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   831
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   832
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   833
.B \f[CB]\-Xmaxerrs\f[R] \f[I]number\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   834
Sets the maximum number of errors to print.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   835
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   836
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   837
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   838
.B \f[CB]\-Xmaxwarns\f[R] \f[I]number\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   839
Sets the maximum number of warnings to print.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   840
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   841
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   842
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   843
.B \f[CB]\-Xpkginfo:\f[R][\f[CB]always\f[R], \f[CB]legacy\f[R], \f[CB]nonempty\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   844
Specifies when and how the \f[CB]javac\f[R] command generates
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   845
\f[CB]package\-info.class\f[R] files from \f[CB]package\-info.java\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   846
files using one of the following options:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   847
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   848
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   849
.B \f[CB]always\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   850
Generates a \f[CB]package\-info.class\f[R] file for every
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   851
\f[CB]package\-info.java\f[R] file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   852
This option may be useful if you use a build system such as Ant, which
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   853
checks that each \f[CB]\&.java\f[R] file has a corresponding
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   854
\f[CB]\&.class\f[R] file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   855
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   856
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   857
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   858
.B \f[CB]legacy\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   859
Generates a \f[CB]package\-info.class\f[R] file only if
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   860
\f[CB]package\-info.java\f[R] contains annotations.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   861
This option does not generate a \f[CB]package\-info.class\f[R] file if
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   862
\f[CB]package\-info.java\f[R] contains only comments.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   863
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   864
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   865
\f[B]Note:\f[R] A \f[CB]package\-info.class\f[R] file might be generated
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   866
but be empty if all the annotations in the \f[CB]package\-info.java\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   867
file have \f[CB]RetentionPolicy.SOURCE\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   868
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   869
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   870
.B \f[CB]nonempty\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   871
Generates a \f[CB]package\-info.class\f[R] file only if
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   872
\f[CB]package\-info.java\f[R] contains annotations with
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   873
\f[CB]RetentionPolicy.CLASS\f[R] or \f[CB]RetentionPolicy.RUNTIME\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   874
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   875
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   876
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   877
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   878
.B \f[CB]\-Xplugin:\f[R]\f[I]name\f[R] \f[I]args\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   879
Specifies the name and optional arguments for a plug\-in to be run.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   880
If \f[I]args\f[R] are provided, \f[I]name\f[R] and \f[I]args\f[R] should be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   881
quoted or otherwise escape the whitespace characters between the name
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   882
and all the arguments.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   883
For details on the API for a plugin, see the API documentation for
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   884
\f[B]jdk.compiler/com.sun.source.util.Plugin\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   885
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   886
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   887
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   888
.B \f[CB]\-Xprefer:\f[R][\f[CB]source\f[R], \f[CB]newer\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   889
Specifies which file to read when both a source file and class file are
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   890
found for an implicitly compiled class using one of the following
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   891
options.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   892
See \f[B]Searching for Module, Package and Type Declarations\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   893
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   894
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   895
\f[CB]\-Xprefer:newer\f[R]: Reads the newer of the source or class files
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   896
for a type (default).
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   897
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   898
\f[CB]\-Xprefer:source\f[R] : Reads the source file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   899
Use \f[CB]\-Xprefer:source\f[R] when you want to be sure that any
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   900
annotation processors can access annotations declared with a retention
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   901
policy of \f[CB]SOURCE\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   902
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   903
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   904
.B \f[CB]\-Xprint\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   905
Prints a textual representation of specified types for debugging
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   906
purposes.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   907
This does not perform annotation processing or compilation.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   908
The format of the output could change.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   909
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   910
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   911
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   912
.B \f[CB]\-XprintProcessorInfo\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   913
Prints information about which annotations a processor is asked to
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   914
process.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   915
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   916
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   917
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   918
.B \f[CB]\-XprintRounds\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   919
Prints information about initial and subsequent annotation processing
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   920
rounds.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   921
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   922
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   923
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   924
.B \f[CB]\-Xstdout\f[R] \f[I]filename\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   925
Sends compiler messages to the named file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   926
By default, compiler messages go to \f[CB]System.err\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   927
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   928
.RE
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   929
.SH ENVIRONMENT VARIABLES
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   930
.SS CLASSPATH
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   931
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   932
If the \f[CB]\-\-class\-path\f[R] option or any of its alternate forms are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   933
not specified, the class path will default to the value of the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   934
\f[CB]CLASSPATH\f[R] environment variable if it is set.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   935
However, it is recommended that this environment variable should
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   936
\f[I]not\f[R] be set, and that the \f[CB]\-\-class\-path\f[R] option should
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   937
be used to provide an explicit value for the class path when one is
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   938
required.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   939
.SS JDK_JAVAC_OPTIONS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   940
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   941
The content of the \f[CB]JDK_JAVAC_OPTIONS\f[R] environment variable,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   942
separated by white\-spaces ( ) or white\-space characters (\f[CB]\\n\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   943
\f[CB]\\t\f[R], \f[CB]\\r\f[R], or \f[CB]\\f\f[R]) is prepended to the command
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   944
line arguments passed to \f[CB]javac\f[R] as a list of arguments.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   945
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   946
The encoding requirement for the environment variable is the same as the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   947
\f[CB]javac\f[R] command line on the system.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   948
\f[CB]JDK_JAVAC_OPTIONS\f[R] environment variable content is treated in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   949
the same manner as that specified in the command line.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   950
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   951
Single quotes (\f[CB]\[aq]\f[R]) or double quotes (\f[CB]"\f[R]) can be used
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   952
to enclose arguments that contain whitespace characters.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   953
All content between the open quote and the first matching close quote
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   954
are preserved by simply removing the pair of quotes.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   955
In case a matching quote is not found, the launcher will abort with an
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   956
error message.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   957
\f[CB]\@\f[R]\f[I]files\f[R] are supported as they are specified in the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   958
command line.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   959
However, as in \f[CB]\@\f[R]\f[I]files\f[R], use of a wildcard is not
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   960
supported.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   961
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   962
\f[B]Examples of quoting arguments containing white spaces:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   963
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   964
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   965
\f[CB]export\ JDK_JAVAC_OPTIONS=\[aq]\@"C:\\white\ spaces\\argfile"\[aq]\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   966
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   967
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   968
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   969
\f[CB]export\ JDK_JAVAC_OPTIONS=\[aq]"\@C:\\white\ spaces\\argfile"\[aq]\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   970
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   971
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   972
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   973
\f[CB]export\ JDK_JAVAC_OPTIONS=\[aq]\@C:\\"white\ spaces"\\argfile\[aq]\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   974
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   975
.SH COMMAND\-LINE ARGUMENT FILES
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   976
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   977
An argument file can include command\-line options and source file names
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   978
in any combination.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   979
The arguments within a file can be separated by spaces or new line
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   980
characters.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   981
If a file name contains embedded spaces, then put the whole file name in
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   982
double quotation marks.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   983
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   984
File names within an argument file are relative to the current
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   985
directory, not to the location of the argument file.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   986
Wildcards (\f[CB]*\f[R]) are not allowed in these lists (such as for
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   987
specifying \f[CB]*.java\f[R]).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   988
Use of the at sign (\f[CB]\@\f[R]) to recursively interpret files is not
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   989
supported.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   990
The \f[CB]\-J\f[R] options are not supported because they\[aq]re passed to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   991
the launcher, which does not support argument files.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   992
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   993
When executing the \f[CB]javac\f[R] command, pass in the path and name of
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   994
each argument file with the at sign (\f[CB]\@\f[R]) leading character.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   995
When the \f[CB]javac\f[R] command encounters an argument beginning with
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   996
the at sign (\f[CB]\@\f[R]), it expands the contents of that file into the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   997
argument list.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
   998
.SS Examples of Using javac \@filename
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   999
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1000
.B Single Argument File
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1001
You could use a single argument file named \f[CB]argfile\f[R] to hold all
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1002
\f[CB]javac\f[R] arguments:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1003
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1004
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1005
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1006
\f[CB]javac\ \@argfile\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1007
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1008
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1009
This argument file could contain the contents of both files shown in the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1010
following \f[B]Two Argument Files\f[R] example.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1011
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1012
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1013
.B Two Argument Files
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1014
You can create two argument files: one for the \f[CB]javac\f[R] options
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1015
and the other for the source file names.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1016
Note that the following lists have no line\-continuation characters.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1017
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1018
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1019
Create a file named \f[CB]options\f[R] that contains the following:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1020
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1021
\f[B]Oracle Solaris, Linux, and macOS:\f[R]
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1022
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1023
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1024
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1025
\-d\ classes
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1026
\-g
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1027
\-sourcepath\ /java/pubs/ws/1.3/src/share/classes
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1028
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1029
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1030
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1031
\f[B]Windows:\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1032
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1033
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1034
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1035
\-d\ classes
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1036
\-g
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1037
\-sourcepath\ C:\\java\\pubs\\ws\\1.3\\src\\share\\classes
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1038
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1039
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1040
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1041
Create a file named \f[CB]classes\f[R] that contains the following:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1042
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1043
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1044
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1045
MyClass1.java
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1046
MyClass2.java
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1047
MyClass3.java
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1048
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1049
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1050
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1051
Then, run the \f[CB]javac\f[R] command as follows:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1052
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1053
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1054
\f[CB]javac\ \@options\ \@classes\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1055
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1056
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1057
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1058
.B Argument Files with Paths
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1059
The argument files can have paths, but any file names inside the files
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1060
are relative to the current working directory (not \f[CB]path1\f[R] or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1061
\f[CB]path2\f[R]):
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1062
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1063
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1064
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1065
\f[CB]javac\ \@path1/options\ \@path2/classes\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1066
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1067
.RE
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1068
.SH ARRANGEMENT OF SOURCE CODE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1069
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1070
In the Java language, classes and interfaces can be organized into
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1071
packages, and packages can be organized into modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1072
\f[CB]javac\f[R] expects that the physical arrangement of source files in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1073
directories of the file system will mirror the organization of classes
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1074
into packages, and packages into modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1075
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1076
It is a widely adopted convention that module names and package names
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1077
begin with a lower\-case letter, and that class names begin with an
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1078
upper\-case letter.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1079
.SS Arrangement of Source Code for a Package
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1080
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1081
When classes and interfaces are organized into a package, the package is
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1082
represented as a directory, and any subpackages are represented as
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1083
subdirectories.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1084
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1085
For example:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1086
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1087
The package \f[CB]p\f[R] is represented as a directory called \f[CB]p\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1088
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1089
The package \f[CB]p.q\f[R] \-\- that is, the subpackage \f[CB]q\f[R] of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1090
package \f[CB]p\f[R] \-\- is represented as the subdirectory \f[CB]q\f[R] of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1091
directory \f[CB]p\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1092
The directory tree representing package \f[CB]p.q\f[R] is therefore
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1093
\f[CB]p\\q\f[R] on Windows, and \f[CB]p/q\f[R] on other systems.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1094
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1095
The package \f[CB]p.q.r\f[R] is represented as the directory tree
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1096
\f[CB]p\\q\\r\f[R] (on Windows) or \f[CB]p/q/r\f[R] (on other systems).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1097
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1098
Within a directory or subdirectory, \f[CB]\&.java\f[R] files represent
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1099
classes and interfaces in the corresponding package or subpackage.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1100
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1101
For example:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1102
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1103
The class \f[CB]X\f[R] declared in package \f[CB]p\f[R] is represented by
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1104
the file \f[CB]X.java\f[R] in the \f[CB]p\f[R] directory.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1105
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1106
The class \f[CB]Y\f[R] declared in package \f[CB]p.q\f[R] is represented by
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1107
the file \f[CB]Y.java\f[R] in the \f[CB]q\f[R] subdirectory of directory
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1108
\f[CB]p\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1109
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1110
The class \f[CB]Z\f[R] declared in package \f[CB]p.q.r\f[R] is represented
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1111
by the file \f[CB]Z.java\f[R] in the \f[CB]r\f[R] subdirectory of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1112
\f[CB]p\\q\f[R] (on Windows) or \f[CB]p/q\f[R] (on other systems).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1113
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1114
In some situations, it is convenient to split the code into separate
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1115
directories, each structured as described above, and the aggregate list
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1116
of directories specified to \f[CB]javac\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1117
.SS Arrangement of Source Code for a Module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1118
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1119
In the Java language, a module is a set of packages designed for reuse.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1120
In addition to \f[CB]\&.java\f[R] files for classes and interfaces, each
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1121
module has a source file called \f[CB]module\-info.java\f[R] which:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1122
.IP "1." 3
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1123
declares the module\[aq]s name;
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1124
.IP "2." 3
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1125
lists the packages exported by the module (to allow reuse by other
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1126
modules);
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1127
.IP "3." 3
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1128
lists other modules required by the module (to reuse their exported
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1129
packages).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1130
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1131
When packages are organized into a module, the module is represented by
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1132
one or more directories representing the packages in the module, one of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1133
which contains the \f[CB]module\-info.java\f[R] file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1134
It may be convenient, but it is not required, to use a single directory,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1135
named after the module, to contain the \f[CB]module\-info.java\f[R] file
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1136
alongside the directory tree which represents the packages in the module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1137
(i.e., the \f[I]package hierarchy\f[R] described above).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1138
The exact arrangement of source code for a module is typically dictated
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1139
by the conventions adopted by a development environment (IDE) or build
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1140
system.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1141
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1142
For example:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1143
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1144
The module \f[CB]a.b.c\f[R] may be represented by the directory
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1145
\f[CB]a.b.c\f[R], on all systems.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1146
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1147
The module\[aq]s declaration is represented by the file
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1148
\f[CB]module\-info.java\f[R] in the \f[CB]a.b.c\f[R] directory.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1149
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1150
If the module contains package \f[CB]p.q.r\f[R], then the \f[CB]a.b.c\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1151
directory contains the directory tree \f[CB]p\\q\\r\f[R] (on Windows) or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1152
\f[CB]p/q/r\f[R] (on other systems).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1153
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1154
The development environment may prescribe some directory hierarchy
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1155
between the directory named for the module and the source files to be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1156
read by \f[CB]javac\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1157
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1158
For example:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1159
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1160
The module \f[CB]a.b.c\f[R] may be represented by the directory
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1161
\f[CB]a.b.c\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1162
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1163
The module\[aq]s declaration and the module\[aq]s packages may be in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1164
some subdirectory of \f[CB]a.b.c\f[R], such as \f[CB]src\\main\\java\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1165
(on Windows) or \f[CB]src/main/java\f[R] (on other systems).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1166
.SH CONFIGURING A COMPILATION
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1167
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1168
This section describes how to configure \f[CB]javac\f[R] to perform a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1169
basic compilation.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1170
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1171
See \f[B]Configuring the Module System\f[R] for additional details for
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1172
use when compiling for a release of the platform that supports modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1173
.SS Source Files
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1174
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1175
Specify the source files to be compiled on the command line.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1176
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1177
If there are no compilation errors, the corresponding class files will
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1178
be placed in the \f[B]output directory\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1179
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1180
Some systems may limit the amount you can put on a command line; to work
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1181
around those limits, you can use \f[B]argument files\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1182
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1183
When compiling code for modules, you can also specify source files
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1184
indirectly, by using the \f[CB]\-\-module\f[R] or \f[CB]\-m\f[R] option; see
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1185
\f[B]Standard Options\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1186
.SS Output Directory
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1187
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1188
Use the \f[CB]\-d\f[R] option to specify an output directory in which to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1189
put the compiled class files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1190
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1191
This will normally be organized in a \f[B]package hierarchy\f[R], unless
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1192
you are compiling source code from multiple modules, in which case it
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1193
will be organized as a \f[B]module hierarchy\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1194
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1195
When the compilation has been completed, if you are compiling one or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1196
more modules, you can place the output directory on the module path for
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1197
the Java \f[B]launcher\f[R]; otherwise, you can place the place the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1198
output directory on the class path for the Java launcher.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1199
.SS Precompiled Code
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1200
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1201
The code to be compiled may refer to libraries beyond what is provided
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1202
by the platform.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1203
If so, you must place these libraries on the class path or module path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1204
If the library code is not in a module, place it on the class path; if
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1205
it is in a module, place it on the module path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1206
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1207
Use the \f[CB]\-\-class\-path\f[R] option to specify libraries to be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1208
placed on the class path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1209
Locations on the class path should be organized in a \f[B]package
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1210
hierarchy\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1211
You can also use alternate forms of the option: \f[CB]\-classpath\f[R] or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1212
\f[CB]\-cp\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1213
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1214
Use the \f[CB]\-\-module\-path\f[R] option to specify libraries to be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1215
placed on the module path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1216
Locations on the module path should either be modules or directories of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1217
modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1218
You can also use an alternate form of the option: \f[CB]\-p\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1219
.RS 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1220
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1221
See \f[B]Configuring the Module System\f[R] for details on how to modify
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1222
the default configuration of library modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1223
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1224
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1225
\f[B]Note\f[R]: the options for the class path and module path are not
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1226
mutually exclusive, although it is not common to specify the class path
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1227
when compiling code for one or more modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1228
.SS Additional Source Files
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1229
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1230
The code to be compiled may refer to types in additional source files
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1231
that are not specified on the command line.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1232
If so, you must put those source files on either the source path or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1233
module path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1234
You can only specify one of these options: if you are not compiling code
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1235
for a module, or if you are only compiling code for a single module, use
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1236
the source path; if you are compiling code for multiple modules, use the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1237
module source path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1238
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1239
Use the \f[CB]\-\-source\-path\f[R] option to specify the locations of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1240
additional source files that may be read by javac.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1241
Locations on the source path should be organized in a \f[B]package
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1242
hierarchy\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1243
You can also use an alternate form of the option: \f[CB]\-sourcepath\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1244
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1245
Use the \f[CB]\-\-module\-source\-path\f[R] option one or more times to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1246
specify the location of additional source files in different modules
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1247
that may be read by javac, or when compiling source files in multiple
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1248
modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1249
You can either specify the locations for each module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1250
\f[B]individually\f[R], or you can organize the source files so that you
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1251
can specify the locations all \f[B]together\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1252
For more details, see \f[B]The Module Source Path Option\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1253
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1254
If you want to be able to refer to types in additional source files but
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1255
do not want them to be compiled, use the \f[CB]\-implicit\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1256
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1257
\f[B]Note\f[R]: if you are compiling code for multiple modules, you must
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1258
always specify a module source path, and all source files specified on
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1259
the command line must be in one of the directories on the module source
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1260
path, or in a subdirectory thereof.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1261
.SS Example of Compiling Multiple Source Files
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1262
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1263
This example compiles the \f[CB]Aloha.java\f[R], \f[CB]GutenTag.java\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1264
\f[CB]Hello.java\f[R], and \f[CB]Hi.java\f[R] source files in the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1265
\f[CB]greetings\f[R] package.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1266
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1267
\f[B]Oracle Solaris, Linux, and macOS:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1268
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1269
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1270
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1271
%\ javac\ greetings/*.java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1272
%\ ls\ greetings
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1273
Aloha.class\ \ \ \ \ \ \ \ \ GutenTag.class\ \ \ \ \ \ Hello.class\ \ \ \ \ \ \ \ \ Hi.class
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1274
Aloha.java\ \ \ \ \ \ \ \ \ \ GutenTag.java\ \ \ \ \ \ \ Hello.java\ \ \ \ \ \ \ \ \ \ Hi.java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1275
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1276
.fi
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1277
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1278
\f[B]Windows:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1279
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1280
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1281
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1282
C:\\>javac\ greetings\\*.java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1283
C:\\>dir\ greetings
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1284
Aloha.class\ \ \ \ \ \ \ \ \ GutenTag.class\ \ \ \ \ \ Hello.class\ \ \ \ \ \ \ \ \ Hi.class
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1285
Aloha.java\ \ \ \ \ \ \ \ \ \ GutenTag.java\ \ \ \ \ \ \ Hello.java\ \ \ \ \ \ \ \ \ \ Hi.java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1286
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1287
.fi
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1288
.SS Example of Specifying a User Class Path
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1289
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1290
After changing one of the source files in the previous example,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1291
recompile it:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1292
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1293
\f[B]Oracle Solaris, Linux, and macOS:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1294
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1295
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1296
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1297
pwd
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1298
/examples
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1299
javac\ greetings/Hi.java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1300
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1301
.fi
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1302
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1303
\f[B]Windows:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1304
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1305
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1306
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1307
C:\\>cd
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1308
\\examples
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1309
C:\\>javac\ greetings\\Hi.java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1310
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1311
.fi
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1312
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1313
Because \f[CB]greetings.Hi\f[R] refers to other classes in the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1314
\f[CB]greetings\f[R] package, the compiler needs to find these other
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1315
classes.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1316
The previous example works because the default user class path is the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1317
directory that contains the package directory.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1318
If you want to recompile this file without concern for which directory
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1319
you are in, then add the examples directory to the user class path by
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1320
setting \f[CB]CLASSPATH\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1321
This example uses the \f[CB]\-classpath\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1322
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1323
\f[B]Oracle Solaris, Linux, and macOS:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1324
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1325
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1326
\f[CB]javac\ \-classpath\ /examples\ /examples/greetings/Hi.java\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1327
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1328
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1329
\f[B]Windows:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1330
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1331
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1332
\f[CB]C:\\>javac\ \-classpath\ \\examples\ \\examples\\greetings\\Hi.java\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1333
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1334
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1335
If you change \f[CB]greetings.Hi\f[R] to use a banner utility, then that
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1336
utility also needs to be accessible through the user class path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1337
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1338
\f[B]Oracle Solaris, Linux, and macOS:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1339
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1340
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1341
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1342
javac\ \-classpath\ /examples:/lib/Banners.jar\ \\
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1343
\ \ \ \ \ \ \ \ \ \ \ \ /examples/greetings/Hi.java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1344
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1345
.fi
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1346
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1347
\f[B]Windows:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1348
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1349
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1350
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1351
C:\\>javac\ \-classpath\ \\examples;\\lib\\Banners.jar\ ^
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1352
\ \ \ \ \ \ \ \ \ \ \ \ \\examples\\greetings\\Hi.java
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1353
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1354
.fi
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1355
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1356
To execute a class in the \f[CB]greetings\f[R] package, the program needs
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1357
access to the \f[CB]greetings\f[R] package, and to the classes that the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1358
\f[CB]greetings\f[R] classes use.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1359
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1360
\f[B]Oracle Solaris, Linux, and macOS:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1361
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1362
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1363
\f[CB]java\ \-classpath\ /examples:/lib/Banners.jar\ greetings.Hi\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1364
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1365
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1366
\f[B]Windows:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1367
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1368
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1369
\f[CB]C:\\>java\ \-classpath\ \\examples;\\lib\\Banners.jar\ greetings.Hi\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1370
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1371
.SH CONFIGURING THE MODULE SYSTEM
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1372
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1373
If you want to include additional modules in your compilation, use the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1374
\f[CB]\-\-add\-modules\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1375
This may be necessary when you are compiling code that is not in a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1376
module, or which is in an automatic module, and the code refers to API
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1377
in the additional modules.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1378
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1379
If you want to restrict the set of modules in your compilation, use the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1380
\f[CB]\-\-limit\-modules\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1381
This may be useful if you want to ensure that the code you are compiling
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1382
is capable of running on a system with a limited set of modules
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1383
installed.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1384
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1385
If you want to break encapsulation and specify that additional packages
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1386
should be considered as exported from a module, use the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1387
\f[CB]\-\-add\-exports\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1388
This may be useful when performing white\-box testing; relying on access
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1389
to internal API in production code is strongly discouraged.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1390
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1391
If you want to specify that additional packages should be considered as
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1392
required by a module, use the \f[CB]\-\-add\-reads\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1393
This may be useful when performing white\-box testing; relying on access
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1394
to internal API in production code is strongly discouraged.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1395
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1396
You can patch additional content into any module using the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1397
\f[CB]\-\-patch\-module\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1398
See [Patching a Module] for more details.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1399
.SH SEARCHING FOR MODULE, PACKAGE AND TYPE DECLARATIONS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1400
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1401
To compile a source file, the compiler often needs information about a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1402
module or type, but the declaration is not in the source files specified
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1403
on the command line.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1404
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1405
\f[CB]javac\f[R] needs type information for every class or interface used,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1406
extended, or implemented in the source file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1407
This includes classes and interfaces not explicitly mentioned in the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1408
source file, but that provide information through inheritance.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1409
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1410
For example, when you create a subclass of \f[CB]java.awt.Window\f[R], you
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1411
are also using the ancestor classes of \f[CB]Window\f[R]:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1412
\f[CB]java.awt.Container\f[R], \f[CB]java.awt.Component\f[R], and
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1413
\f[CB]java.lang.Object\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1414
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1415
When compiling code for a module, the compiler also needs to have
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1416
available the declaration of that module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1417
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1418
A successful search may produce a class file, a source file, or both.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1419
If both are found, then you can use the \f[CB]\-Xprefer\f[R] option to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1420
instruct the compiler which to use; see \f[B]Extra Options\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1421
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1422
If a search finds and uses a source file, then by default \f[CB]javac\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1423
compiles that source file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1424
This behavior can be altered with \f[CB]\-implicit\f[R]; see \f[B]Standard
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1425
Options\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1426
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1427
The compiler might not discover the need for some type information until
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1428
after annotation processing completes.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1429
When the type information is found in a source file and no
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1430
\f[CB]\-implicit\f[R] option is specified, the compiler gives a warning
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1431
that the file is being compiled without being subject to annotation
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1432
processing.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1433
To disable the warning, either specify the file on the command line (so
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1434
that it will be subject to annotation processing) or use the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1435
\f[CB]\-implicit\f[R] option to specify whether or not class files should
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1436
be generated for such source files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1437
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1438
The way that \f[CB]javac\f[R] locates the declarations of those types
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1439
depends on whether the reference exists within code for a module or not.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1440
.SS Searching Package Oriented Paths
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1441
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1442
When searching for a source or class file on a path composed of package
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1443
oriented locations, \f[CB]javac\f[R] will check each location on the path
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1444
in turn for the possible presence of the file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1445
The first occurrence of a particular file shadows (hides) any subsequent
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1446
occurrences of like\-named files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1447
This shadowing does not affect any search for any files with a different
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1448
name.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1449
This can be convenient when searching for source files, which may be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1450
grouped in different locations, such as shared code, platform\-specific
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1451
code and generated code.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1452
It can also be useful when injecting alternate versions of a class file
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1453
into a package, to debugging or other instrumentation reasons.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1454
But, it can also be dangerous, such as when putting incompatible
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1455
different versions of a library on the class path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1456
.SS Searching Module Oriented Paths
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1457
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1458
Prior to scanning any module paths for any package or type declarations,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1459
\f[CB]javac\f[R] will lazily scan the following paths and locations to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1460
determine the modules that will be used in the compilation.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1461
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1462
The module source path (see the \f[CB]\-\-module\-source\-path\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1463
option)
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1464
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1465
The path for upgradeable modules (see the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1466
\f[CB]\-\-upgrade\-module\-path\f[R] option)
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1467
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1468
The system modules (see the \f[CB]\-\-system\f[R] option)
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1469
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1470
The user module path ( see the \f[CB]\-\-module\-path\f[R] option)
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1471
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1472
For any module, the first occurrence of the module during the scan
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1473
completely shadows (hides) any subsequent appearance of a like\-named
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1474
module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1475
While locating the modules, \f[CB]javac\f[R] is able to determine the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1476
packages exported by the module and to associate with each module a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1477
package oriented path for the contents of the module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1478
For any previously compiled module, this path will typically be a single
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1479
entry for either a directory or a file that provides an internal
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1480
directory\-like hierarchy, such as a JAR file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1481
Thus, when searching for a type that is in a package that is known to be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1482
exported by a module, \f[CB]javac\f[R] can locate the declaration directly
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1483
and efficiently.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1484
.SS Searching for the Declaration of a Module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1485
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1486
If the module has been previously compiled, the module declaration is
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1487
located in a file named \f[CB]module\-info.class\f[R] in the root of the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1488
package hierarchy for the content of the module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1489
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1490
If the module is one of those currently being compiled, the module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1491
declaration will be either the file named \f[CB]module\-info.class\f[R] in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1492
the root of the package hierarchy for the module in the class output
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1493
directory, or the file named \f[CB]module\-info.java\f[R] in one of the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1494
locations on the source path or one the module source path for the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1495
module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1496
.SS Searching for the Declaration of a Type When the Reference is not in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1497
a Module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1498
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1499
When searching for a type that is referenced in code that is not in a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1500
module, \f[CB]javac\f[R] will look in the following places:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1501
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1502
The platform classes (or the types in exported packages of the platform
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1503
modules) (This is for compiled class files only.)
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1504
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1505
Types in exported packages of any modules on the module path, if
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1506
applicable.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1507
(This is for compiled class files only.)
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1508
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1509
Types in packages on the class path and/or source path:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1510
.RS 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1511
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1512
If both are specified, \f[CB]javac\f[R] looks for compiled class files on
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1513
the class path and for source files on the source path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1514
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1515
If the class path is specified, but not source path, \f[CB]javac\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1516
looks for both compiled class files and source files on the class path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1517
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1518
If the class path is not specified, it defaults to the current
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1519
directory.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1520
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1521
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1522
When looking for a type on the class path and/or source path, if both a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1523
compiled class file and a source file are found, the most recently
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1524
modified file will be used by default.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1525
If the source file is newer, it will be compiled and will may override
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1526
any previously compiled version of the file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1527
You can use the \f[CB]\-Xprefer\f[R] option to override the default
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1528
behavior.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1529
.SS Searching for the Declaration of a Type When the Reference is in a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1530
Module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1531
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1532
When searching for a type that is referenced in code in a module,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1533
\f[CB]javac\f[R] will examine the declaration of the enclosing module to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1534
determine if the type is in a package that is exported from another
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1535
module that is readable by the enclosing module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1536
If so, \f[CB]javac\f[R] will simply and directly go to the definition of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1537
that module to find the definition of the required type.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1538
Unless the module is another of the modules being compiled,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1539
\f[CB]javac\f[R] will only look for compiled class files files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1540
In other words, \f[CB]javac\f[R] will not look for source files in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1541
platform modules or modules on the module path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1542
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1543
If the type being referenced is not in some other readable module,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1544
\f[CB]javac\f[R] will examine the module being compiled to try and find
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1545
the declaration of the type.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1546
\f[CB]javac\f[R] will look for the declaration of the type as follows:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1547
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1548
Source files specified on the command line or on the source path or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1549
module source path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1550
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1551
Previously compiled files in the output directory.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1552
.SH DIRECTORY HIERARCHIES
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1553
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1554
\f[CB]javac\f[R] generally assumes that source files and compiled class
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1555
files will be organized in a file system directory hierarchy or in a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1556
type of file that supports in an internal directory hierarchy, such as a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1557
JAR file.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1558
Three different kinds of hierarchy are supported: a \f[I]package
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1559
hierarchy\f[R], a \f[I]module hierarchy\f[R], and a \f[I]module source
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1560
hierarchy\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1561
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1562
While \f[CB]javac\f[R] is fairly relaxed about the organization of source
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1563
code, beyond the expectation that source will be organized in one or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1564
package hierarchies, and can generally accomodate organizations
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1565
prescribed by development environments and build tools, Java tools in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1566
general, and \f[CB]javac\f[R] and the Java launcher in particular, are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1567
more stringent regarding the organization of compiled class files, and
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1568
will be organized in package hierarchies or module hierarchies, as
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1569
appropriate.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1570
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1571
The location of these hierarchies are specified to \f[CB]javac\f[R] with
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1572
command\-line options, whose names typically end in "path", like
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1573
\f[CB]\-\-source\-path\f[R] or \f[CB]\-\-class\-path\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1574
Also as a general rule, path options whose name includes the word
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1575
\f[CB]module\f[R], like \f[CB]\-\-module\-path\f[R], are used to specify
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1576
module hierarchies, although some module\-related path options allow a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1577
package hierarchy to be specified on a per\-module basis.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1578
All other path options are used to specify package hierarchies.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1579
.SS Package Hierarchy
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1580
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1581
In a package hierarchy, directories and subdirectories are used to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1582
represent the component parts of the package name, with the source file
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1583
or compiled class file for a type being stored as a file with an
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1584
extension of \f[CB]\&.java\f[R] or \f[CB]\&.class\f[R] in the most nested
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1585
directory.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1586
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1587
For example, in a package hierarchy, the source file for a class
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1588
\f[CB]com.example.MyClass\f[R] will be stored in the file
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1589
\f[I]com/example/MyClass.java\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1590
.SS Module Hierarchy
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1591
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1592
In a module hierarchy, the first level of directories are named for the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1593
modules in the hierarchy; within each of those directories the contents
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1594
of the module are organized in package hierarchies.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1595
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1596
For example, in a module hierarchy, the compiled class file for a type
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1597
called \f[CB]com.example.MyClass\f[R] in a module called
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1598
\f[CB]my.library\f[R] will be stored in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1599
\f[I]my.library/com/example/MyClass.class\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1600
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1601
The various output directories used by \f[CB]javac\f[R] (the class output
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1602
directory, the source output directory, and native header output
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1603
directory) will all be organized in a module hierarchy when multiple
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1604
modules are being compiled.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1605
.SS Module Source Hierarchy
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1606
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1607
Although the source for each individual module should always be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1608
organized in a package hierarchy, it may be convenient to group those
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1609
hierarchies into a module source hierarchy.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1610
This is similar to a module hierarchy, except that there may be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1611
intervening directories between the directory for the module and the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1612
directory that is the root of the package hierarchy for the source code
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1613
of the module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1614
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1615
For example, in a module source hierarchy, the source file for a type
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1616
called \f[CB]com.example.MyClass\f[R] in a module called
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1617
\f[CB]my.library\f[R] may be stored in a file such as
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1618
\f[I]my.library/src/main/java/com/example/MyClass.java\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1619
.SH THE MODULE SOURCE PATH OPTION
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1620
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1621
The \f[CB]\-\-module\-source\-path\f[R] option has two forms: a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1622
\f[I]module\-specific form\f[R], in which a package path is given for
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1623
each module containing code to be compiled, and a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1624
\f[I]module\-pattern\f[R] form, in which the source path for each module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1625
is specified by a pattern.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1626
The module\-specific form is generally simpler to use when only a small
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1627
number of modules are involved; the module\-pattern form may be more
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1628
convenient when the number of modules is large and the modules are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1629
organized in a regular manner that can be described by a pattern.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1630
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1631
Multiple instances of the \f[CB]\-\-module\-source\-path\f[R] option may
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1632
be given, each one using either the module\-pattern form or the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1633
module\-specific form, subject to the following limitations:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1634
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1635
the module\-pattern form may be used at most once
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1636
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1637
the module\-specific form may be used at most once for any given module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1638
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1639
If the module\-specific form is used for any module, the associated
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1640
search path overrides any path that might otherwise have been inferred
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1641
from the module\-pattern form.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1642
.SS Module\-specific form
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1643
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1644
The module\-specific form allows an explicit search path to be given for
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1645
any specific module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1646
This form is:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1647
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1648
\f[CB]\-\-module\-source\-path\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1649
\f[I]module\-name\f[R]\f[CB]=\f[R]\f[I]file\-path\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1650
(\f[I]path\-separator\f[R] \f[I]file\-path\f[R])*
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1651
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1652
The path separator character is \f[CB];\f[R] on Windows, and \f[CB]:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1653
otherwise.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1654
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1655
\f[B]Note:\f[R] this is similar to the form used for the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1656
\f[CB]\-\-patch\-module\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1657
.SS Module\-pattern form
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1658
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1659
The module\-pattern form allows a concise specification of the module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1660
source path for any number of modules organized in regular manner.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1661
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1662
\f[CB]\-\-module\-source\-path\f[R] \f[I]pattern\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1663
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1664
The pattern is defined by the following rules, which are applied in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1665
order:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1666
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1667
The argument is considered to be a series of segments separated by the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1668
path separator character (\f[CB];\f[R] on Windows, and \f[CB]:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1669
otherwise).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1670
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1671
Each segment containing curly braces of the form
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1672
.RS 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1673
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1674
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1675
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1676
string1{alt1\ (\ ,alt2\ )*\ }\ string2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1677
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1678
.fi
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1679
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1680
is considered to be replaced by a series of segments formed by
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1681
"expanding" the braces:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1682
.IP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1683
.nf
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1684
\f[CB]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1685
string1\ alt1\ string2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1686
string1\ alt2\ string2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1687
and\ so\ on...
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1688
\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1689
.fi
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1690
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1691
The braces may be nested.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1692
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1693
This rule is applied for all such usages of braces.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1694
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1695
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1696
Each segment must have at most one asterisk (\f[CB]*\f[R]).
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1697
If a segment does not contain an asterisk, it is considered to be as
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1698
though the file separator character and an asterisk are appended.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1699
.RS 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1700
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1701
For any module \f[I]M\f[R], the source path for that module is formed
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1702
from the series of segments obtained by substituting the module name
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1703
\f[I]M\f[R] for the asterisk in each segment.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1704
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1705
\f[B]Note\f[R]: in this context, the asterisk is just used as a special
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1706
marker, to denote the position in the path of the module name.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1707
It should not be confused with the use of \f[CB]*\f[R] as a file name
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1708
wildcard character, as found on most operating systems.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1709
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1710
.SH PATCHING MODULES
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1711
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1712
javac allows any content, whether in source or compiled form, to be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1713
patched into any module using the \f[CB]\-\-patch\-module\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1714
You may want to do this to compile alternative implementations of a
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1715
class to be patched at runtime into a JVM, or to inject additional
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1716
classes into the module, such as when testing.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1717
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1718
The form of the option is:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1719
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1720
\f[CB]\-\-patch\-module\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1721
\f[I]module\-name\f[R]\f[CB]=\f[R]\f[I]file\-path\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1722
(\f[I]path\-separator\f[R] \f[I]file\-path\f[R] )*
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1723
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1724
The path separator character is \f[CB];\f[R] on Windows, and \f[CB]:\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1725
otherwise.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1726
The paths given for the module must specify the root of a package
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1727
hierarchy for the contents of the module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1728
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1729
The option may be given at most once for any given module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1730
Any content on the path will hide any like\-named content later in the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1731
path and in the patched module.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1732
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1733
When patching source code into more than one module, the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1734
\f[CB]\-\-module\-source\-path\f[R] must also be used, so that the output
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1735
directory is organized in a module hierarchy, and capable of holding the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1736
compiled class files for the modules being compiled.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1737
.SH ANNOTATION PROCESSING
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1738
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1739
The \f[CB]javac\f[R] command provides direct support for annotation
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1740
processing.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1741
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1742
The API for annotation processors is defined in the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1743
\f[CB]javax.annotation.processing\f[R] and \f[CB]javax.lang.model\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1744
packages and subpackages.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1745
.SS How Annotation Processing Works
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1746
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1747
Unless annotation processing is disabled with the \f[CB]\-proc:none\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1748
option, the compiler searches for any annotation processors that are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1749
available.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1750
The search path can be specified with the \f[CB]\-processorpath\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1751
option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1752
If no path is specified, then the user class path is used.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1753
Processors are located by means of service provider\-configuration files
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1754
named \f[CB]META\-INF/services/javax.annotation.processing\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1755
Processor on the search path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1756
Such files should contain the names of any annotation processors to be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1757
used, listed one per line.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1758
Alternatively, processors can be specified explicitly, using the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1759
\f[CB]\-processor\f[R] option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1760
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1761
After scanning the source files and classes on the command line to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1762
determine what annotations are present, the compiler queries the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1763
processors to determine what annotations they process.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1764
When a match is found, the processor is called.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1765
A processor can claim the annotations it processes, in which case no
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1766
further attempt is made to find any processors for those annotations.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1767
After all of the annotations are claimed, the compiler does not search
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1768
for additional processors.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1769
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1770
If any processors generate new source files, then another round of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1771
annotation processing occurs: Any newly generated source files are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1772
scanned, and the annotations processed as before.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1773
Any processors called on previous rounds are also called on all
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1774
subsequent rounds.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1775
This continues until no new source files are generated.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1776
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1777
After a round occurs where no new source files are generated, the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1778
annotation processors are called one last time, to give them a chance to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1779
complete any remaining work.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1780
Finally, unless the \f[CB]\-proc:only\f[R] option is used, the compiler
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1781
compiles the original and all generated source files.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1782
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1783
If you use an annotation processor that generates additional source
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1784
files to be included in the compilation, you can specify a default
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1785
module to be used for the newly generated files, for use when a module
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1786
declaration is not also generated.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1787
In this case, use the \f[CB]\-\-default\-module\-for\-created\-files\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1788
option.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1789
.SS Compilation Environment and Runtime Environment.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1790
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1791
The declarations in source files and previously compiled class files are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1792
analyzed by \f[CB]javac\f[R] in a \f[I]compilation environment\f[R] that is
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1793
distinct from the \f[I]runtime environment\f[R] used to execute
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1794
\f[CB]javac\f[R] itself.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1795
Although there is a deliberate similarity between many \f[CB]javac\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1796
options and like\-named options for the Java \f[B]launcher\f[R], such as
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1797
\f[CB]\-\-class\-path\f[R], \f[CB]\-\-module\-path\f[R] and so on, it is
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1798
important to understand that in general the \f[CB]javac\f[R] options just
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1799
affect the environment in which the source files are compiled, and do
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1800
not affect the operation of \f[CB]javac\f[R] itself.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1801
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1802
The distinction between the compilation environment and runtime
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1803
environment is significant when it comes to using annotation processors.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1804
Although annotations processors process elements (declarations) that
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1805
exist in the compilation environment, the annotation processor itself is
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1806
executed in the runtime environment.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1807
If an annotation processor has dependencies on libraries that are not in
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1808
modules, the libraries can be placed, along with the annotation
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1809
processor itself, on the processor path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1810
(See the \f[CB]\-\-processor\-path\f[R] option.) If the annotation
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1811
processor and its dependencies are in modules, you should use the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1812
processor module path instead.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1813
(See the \f[CB]\-\-processor\-module\-path\f[R] option.) When those are
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1814
insufficient, it may be necessary to provide further configuration of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1815
the runtime environment.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1816
This can be done in two ways:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1817
.IP "1." 3
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1818
If \f[CB]javac\f[R] is invoked from the command line, options can be
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1819
passed to the underlying runtime by prefixing the option with
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1820
\f[CB]\-J\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1821
(See the \f[CB]\-J\f[R] option.)
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1822
.IP "2." 3
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1823
You can start an instance of a Java Virtual Machine directly and use
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1824
command line options and API to configure an environment in which
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1825
\f[CB]javac\f[R] can be invoked via one of its \f[B]APIs\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1826
.SH COMPILING FOR EARLIER RELEASES OF THE PLATFORM
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1827
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1828
\f[CB]javac\f[R] can compile code that is to be used on other releases of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1829
the platform, using either the \f[CB]\-\-release\f[R] option, or the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1830
\f[CB]\-\-source\f[R]/\f[CB]\-source\f[R] and
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1831
\f[CB]\-\-target\f[R]/\f[CB]\-target\f[R] options, together with additional
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1832
options to specify the platform classes.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1833
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1834
Depending on the desired platform release, there are some restrictions
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1835
on some of the options that can be used.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1836
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1837
When compiling for JDK 8 and earlier releases, you cannot use any option
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1838
that is intended for use with the module system.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1839
This includes all of the following options:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1840
.RS 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1841
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1842
\f[CB]\-\-module\-source\-path\f[R], \f[CB]\-\-upgrade\-module\-path\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1843
\f[CB]\-\-system\f[R], \f[CB]\-\-module\-path\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1844
\f[CB]\-\-add\-modules\f[R], \f[CB]\-\-add\-exports\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1845
\f[CB]\-\-add\-opens\f[R], \f[CB]\-\-add\-reads\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1846
\f[CB]\-\-limit\-modules\f[R], \f[CB]\-\-patch\-module\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1847
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1848
If you use the \f[CB]\-\-source\f[R]/\f[CB]\-source\f[R] or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1849
\f[CB]\-\-target\f[R]/\f[CB]\-target\f[R] options, you should also set the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1850
appropriate platform classes using the boot class path family of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1851
options.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1852
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1853
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1854
When compiling for JDK 9 and later releases, you cannot use any option
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1855
that is intended to configure the boot class path.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1856
This includes all of the following options:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1857
.RS 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1858
.IP \[bu] 2
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1859
\f[CB]\-Xbootclasspath/p:\f[R], \f[CB]\-Xbootclasspath\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1860
\f[CB]\-Xbootclasspath/a:\f[R], \f[CB]\-endorseddirs\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1861
\f[CB]\-Djava.endorsed.dirs\f[R], \f[CB]\-extdirs\f[R],
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1862
\f[CB]\-Djava.ext.dirs\f[R], \f[CB]\-profile\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1863
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1864
If you use the \f[CB]\-\-source\f[R]/\f[CB]\-source\f[R] or
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1865
\f[CB]\-\-target\f[R]/\f[CB]\-target\f[R] options, you should also set the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1866
appropriate platform classes using the \f[CB]\-\-system\f[R] option to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1867
give the location of an appropriate installed release of JDK.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1868
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1869
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1870
When using the \f[CB]\-\-release\f[R] option, only the supported
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1871
documented API for that release may be used; you cannot use any options
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1872
to break encapsulation to access any internal classes.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1873
.SH APIS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1874
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1875
The \f[CB]javac\f[R] compiler can be invoked using an API in three
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1876
different ways:
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1877
.TP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1878
.B The \f[B]Java Compiler API\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1879
This provides the most flexible way to invoke the compiler, including
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1880
the ability to compile source files provided in memory buffers or other
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1881
non\-standard file systems.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1882
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1883
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1884
.TP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1885
.B The \f[B]ToolProvider API\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1886
A \f[CB]ToolProvider\f[R] for \f[CB]javac\f[R] can be obtained by calling
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1887
\f[CB]ToolProvider.findFirst("javac")\f[R].
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1888
This returns an object with the equivalent functionality of the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1889
command\-line tool.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1890
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1891
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1892
\f[B]Note\f[R]: This API should not be confused with the like\-named API
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1893
in the \f[B]\f[BC]javax.tools\f[B]\f[R] package.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1894
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1895
.TP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1896
.B The \f[CB]javac\f[R] \f[B]Legacy API\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1897
This API is retained for backward compatibility only.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1898
All new code should use either the Java Compiler API or the ToolProvider
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1899
API.
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1900
.RS
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1901
.RE
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1902
.PP
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1903
\f[B]Note:\f[R] All other classes and methods found in a package with
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1904
names that start with \f[CB]com.sun.tools.javac\f[R] (subpackages of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1905
\f[CB]com.sun.tools.javac\f[R]) are strictly internal and subject to
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1906
change at any time.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1907
.SH EXAMPLES OF USING \-XLINT KEYS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1908
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1909
.B \f[CB]cast\f[R]
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  1910
Warns about unnecessary and redundant casts, for example:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1911
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1912
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1913
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1914
\f[CB]String\ s\ =\ (String)\ "Hello!"\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1915
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1916
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1917
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1918
.B \f[CB]classfile\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1919
Warns about issues related to class file contents.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1920
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1921
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1922
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1923
.B \f[CB]deprecation\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1924
Warns about the use of deprecated items.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1925
For example:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1926
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1927
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1928
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1929
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1930
java.util.Date\ myDate\ =\ new\ java.util.Date();
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1931
int\ currentDay\ =\ myDate.getDay();
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1932
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1933
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1934
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1935
The method \f[CB]java.util.Date.getDay\f[R] has been deprecated since JDK
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1936
1.1.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1937
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1938
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1939
.B \f[CB]dep\-ann\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1940
Warns about items that are documented with the \f[CB]\@deprecated\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1941
Javadoc comment, but do not have the \f[CB]\@Deprecated\f[R] annotation,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1942
for example:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1943
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1944
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1945
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1946
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1947
/**
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1948
\ \ *\ \@deprecated\ As\ of\ Java\ SE\ 7,\ replaced\ by\ {\@link\ #newMethod()}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1949
\ \ */
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1950
public\ static\ void\ deprecatedMethod()\ {\ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1951
public\ static\ void\ newMethod()\ {\ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1952
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1953
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1954
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1955
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1956
.B \f[CB]divzero\f[R]
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  1957
Warns about division by the constant integer 0, for example:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1958
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1959
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1960
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1961
\f[CB]int\ divideByZero\ =\ 42\ /\ 0;\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1962
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1963
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1964
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1965
.B \f[CB]empty\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1966
Warns about empty statements after \f[CB]if\f[R]statements, for example:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1967
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1968
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1969
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1970
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1971
class\ E\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1972
\ \ \ \ void\ m()\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1973
\ \ \ \ \ \ \ \ \ if\ (true)\ ;
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1974
\ \ \ \ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1975
}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1976
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1977
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1978
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1979
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1980
.B \f[CB]fallthrough\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1981
Checks the switch blocks for fall\-through cases and provides a warning
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1982
message for any that are found.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1983
Fall\-through cases are cases in a switch block, other than the last
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1984
case in the block, whose code does not include a \f[CB]break\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1985
statement, allowing code execution to fall through from that case to the
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1986
next case.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1987
For example, the code following the case 1 label in this switch block
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  1988
does not end with a \f[CB]break\f[R] statement:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1989
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1990
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1991
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1992
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1993
switch\ (x)\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1994
case\ 1:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1995
\ \ System.out.println("1");
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1996
\ \ //\ No\ break\ statement\ here.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1997
case\ 2:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1998
\ \ System.out.println("2");
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  1999
}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2000
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2001
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2002
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2003
If the \f[CB]\-Xlint:fallthrough\f[R] option was used when compiling this
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2004
code, then the compiler emits a warning about possible fall\-through
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2005
into case, with the line number of the case in question.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2006
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2007
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2008
.B \f[CB]finally\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2009
Warns about \f[CB]finally\f[R] clauses that cannot be completed normally,
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2010
for example:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2011
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2012
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2013
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2014
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2015
public\ static\ int\ m()\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2016
\ \ try\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2017
\ \ \ \ \ throw\ new\ NullPointerException();
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2018
\ \ }\ \ catch\ (NullPointerException();\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2019
\ \ \ \ \ System.err.println("Caught\ NullPointerException.");
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2020
\ \ \ \ \ return\ 1;
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2021
\ \ \ }\ finally\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2022
\ \ \ \ \ return\ 0;
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2023
\ \ \ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2024
\ \ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2025
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2026
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2027
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2028
The compiler generates a warning for the \f[CB]finally\f[R] block in this
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2029
example.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2030
When the \f[CB]int\f[R] method is called, it returns a value of 0.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2031
A \f[CB]finally\f[R] block executes when the \f[CB]try\f[R] block exits.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2032
In this example, when control is transferred to the \f[CB]catch\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2033
block, the \f[CB]int\f[R] method exits.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2034
However, the \f[CB]finally\f[R] block must execute, so it\[aq]s executed,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2035
even though control was transferred outside the method.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2036
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2037
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2038
.B \f[CB]options\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2039
Warns about issues that related to the use of command\-line options.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2040
See \f[B]Compiling for Earlier Releases of the Platform\f[R].
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2041
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2042
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2043
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2044
.B \f[CB]overrides\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2045
Warns about issues related to method overrides.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2046
For example, consider the following two classes:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2047
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2048
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2049
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2050
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2051
public\ class\ ClassWithVarargsMethod\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2052
\ \ void\ varargsMethod(String...\ s)\ {\ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2053
}
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2054
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2055
public\ class\ ClassWithOverridingMethod\ extends\ ClassWithVarargsMethod\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2056
\ \ \ \@Override
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2057
\ \ \ void\ varargsMethod(String[]\ s)\ {\ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2058
}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2059
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2060
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2061
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2062
The compiler generates a warning similar to the following:.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2063
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2064
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2065
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2066
warning:\ [override]\ varargsMethod(String[])\ in\ ClassWithOverridingMethod
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2067
overrides\ varargsMethod(String...)\ in\ ClassWithVarargsMethod;\ overriding
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2068
method\ is\ missing\ \[aq]...\[aq]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2069
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2070
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2071
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2072
When the compiler encounters a \f[CB]varargs\f[R] method, it translates
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2073
the \f[CB]varargs\f[R] formal parameter into an array.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2074
In the method \f[CB]ClassWithVarargsMethod.varargsMethod\f[R], the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2075
compiler translates the \f[CB]varargs\f[R] formal parameter
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2076
\f[CB]String...\ s\f[R] to the formal parameter \f[CB]String[]\ s\f[R], an
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2077
array that matches the formal parameter of the method
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2078
\f[CB]ClassWithOverridingMethod.varargsMethod\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2079
Consequently, this example compiles.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2080
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2081
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2082
.B \f[CB]path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2083
Warns about invalid path elements and nonexistent path directories on
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2084
the command line (with regard to the class path, the source path, and
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2085
other paths).
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2086
Such warnings cannot be suppressed with the \f[CB]\@SuppressWarnings\f[R]
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2087
annotation.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2088
For example:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2089
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2090
.IP \[bu] 2
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2091
\f[B]Oracle Solaris, Linux, and macOS:\f[R]
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2092
\f[CB]javac\ \-Xlint:path\ \-classpath\ /nonexistentpath\ Example.java\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2093
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2094
\f[B]Windows:\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2095
\f[CB]javac\ \-Xlint:path\ \-classpath\ C:\\nonexistentpath\ Example.java\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2096
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2097
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2098
.B \f[CB]processing\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2099
Warns about issues related to annotation processing.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2100
The compiler generates this warning when you have a class that has an
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2101
annotation, and you use an annotation processor that cannot handle that
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2102
type of exception.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2103
For example, the following is a simple annotation processor:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2104
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2105
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2106
\f[B]Source file AnnocProc.java\f[R]:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2107
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2108
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2109
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2110
import\ java.util.*;
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2111
import\ javax.annotation.processing.*;
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2112
import\ javax.lang.model.*;
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2113
import\ javaz.lang.model.element.*;
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2114
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2115
\@SupportedAnnotationTypes("NotAnno")
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2116
public\ class\ AnnoProc\ extends\ AbstractProcessor\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2117
\ \ public\ boolean\ process(Set<?\ extends\ TypeElement>\ elems,\ RoundEnvironment\ renv){
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2118
\ \ \ \ \ return\ true;
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2119
\ \ }
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2120
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2121
\ \ public\ SourceVersion\ getSupportedSourceVersion()\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2122
\ \ \ \ \ return\ SourceVersion.latest();
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2123
\ \ \ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2124
}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2125
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2126
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2127
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2128
\f[B]Source file AnnosWithoutProcessors.java\f[R]:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2129
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2130
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2131
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2132
\@interface\ Anno\ {\ }
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
  2133
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2134
\@Anno
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2135
class\ AnnosWithoutProcessors\ {\ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2136
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2137
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2138
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2139
The following commands compile the annotation processor
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2140
\f[CB]AnnoProc\f[R], then run this annotation processor against the source
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2141
file \f[CB]AnnosWithoutProcessors.java\f[R]:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2142
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2143
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2144
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2145
javac\ AnnoProc.java
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2146
javac\ \-cp\ .\ \-Xlint:processing\ \-processor\ AnnoProc\ \-proc:only\ AnnosWithoutProcessors.java
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2147
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2148
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2149
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2150
When the compiler runs the annotation processor against the source file
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2151
\f[CB]AnnosWithoutProcessors.java\f[R], it generates the following
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2152
warning:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2153
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2154
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2155
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2156
warning:\ [processing]\ No\ processor\ claimed\ any\ of\ these\ annotations:\ Anno
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2157
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2158
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2159
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2160
To resolve this issue, you can rename the annotation defined and used in
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2161
the class \f[CB]AnnosWithoutProcessors\f[R] from \f[CB]Anno\f[R] to
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2162
\f[CB]NotAnno\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2163
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2164
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2165
.B \f[CB]rawtypes\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2166
Warns about unchecked operations on raw types.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2167
The following statement generates a \f[CB]rawtypes\f[R] warning:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2168
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2169
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2170
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2171
\f[CB]void\ countElements(List\ l)\ {\ ...\ }\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2172
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2173
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2174
The following example does not generate a \f[CB]rawtypes\f[R] warning:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2175
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2176
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2177
\f[CB]void\ countElements(List<?>\ l)\ {\ ...\ }\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2178
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2179
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2180
\f[CB]List\f[R] is a raw type.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2181
However, \f[CB]List<?>\f[R] is an unbounded wildcard parameterized type.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2182
Because \f[CB]List\f[R] is a parameterized interface, always specify its
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2183
type argument.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2184
In this example, the \f[CB]List\f[R] formal argument is specified with an
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2185
unbounded wildcard (\f[CB]?\f[R]) as its formal type parameter, which
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2186
means that the \f[CB]countElements\f[R] method can accept any
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2187
instantiation of the \f[CB]List\f[R] interface.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2188
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2189
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2190
.B \f[CB]serial\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2191
Warns about missing \f[CB]serialVersionUID\f[R] definitions on
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2192
serializable classes.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2193
For example:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2194
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2195
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2196
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2197
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2198
public\ class\ PersistentTime\ implements\ Serializable
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2199
{
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2200
\ \ private\ Date\ time;
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2201
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2202
\ \ \ public\ PersistentTime()\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2203
\ \ \ \ \ time\ =\ Calendar.getInstance().getTime();
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2204
\ \ \ }
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2205
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2206
\ \ \ public\ Date\ getTime()\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2207
\ \ \ \ \ return\ time;
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2208
\ \ \ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2209
}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2210
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2211
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2212
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2213
The compiler generates the following warning:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2214
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2215
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2216
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2217
warning:\ [serial]\ serializable\ class\ PersistentTime\ has\ no\ definition\ of
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2218
serialVersionUID
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2219
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2220
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2221
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2222
If a serializable class does not explicitly declare a field named
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2223
\f[CB]serialVersionUID\f[R], then the serialization runtime environment
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2224
calculates a default \f[CB]serialVersionUID\f[R] value for that class
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2225
based on various aspects of the class, as described in the Java Object
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2226
Serialization Specification.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2227
However, it\[aq]s strongly recommended that all serializable classes
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2228
explicitly declare \f[CB]serialVersionUID\f[R] values because the default
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2229
process of computing \f[CB]serialVersionUID\f[R] values is highly
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2230
sensitive to class details that can vary depending on compiler
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2231
implementations.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2232
As a result, this might cause an unexpected
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2233
\f[CB]InvalidClassExceptions\f[R] during deserialization.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2234
To guarantee a consistent \f[CB]serialVersionUID\f[R] value across
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2235
different Java compiler implementations, a serializable class must
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2236
declare an explicit \f[CB]serialVersionUID\f[R] value.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2237
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2238
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2239
.B \f[CB]static\f[R]
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2240
Warns about issues relating to the use of static variables, for example:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2241
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2242
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2243
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2244
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2245
class\ XLintStatic\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2246
\ \ \ \ static\ void\ m1()\ {\ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2247
\ \ \ \ void\ m2()\ {\ this.m1();\ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2248
}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2249
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2250
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2251
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2252
The compiler generates the following warning:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2253
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2254
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2255
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2256
warning:\ [static]\ static\ method\ should\ be\ qualified\ by\ type\ name,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2257
XLintStatic,\ instead\ of\ by\ an\ expression
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2258
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2259
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2260
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2261
To resolve this issue, you can call the \f[CB]static\f[R] method
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2262
\f[CB]m1\f[R] as follows:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2263
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2264
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2265
\f[CB]XLintStatic.m1();\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2266
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2267
.PP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2268
Alternately, you can remove the \f[CB]static\f[R] keyword from the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2269
declaration of the method \f[CB]m1\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2270
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2271
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2272
.B \f[CB]try\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2273
Warns about issues relating to the use of \f[CB]try\f[R] blocks, including
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2274
try\-with\-resources statements.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2275
For example, a warning is generated for the following statement because
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2276
the resource \f[CB]ac\f[R] declared in the \f[CB]try\f[R] block is not used:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2277
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2278
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2279
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2280
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2281
try\ (\ AutoCloseable\ ac\ =\ getResource()\ )\ {\ \ \ \ //\ do\ nothing}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2282
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2283
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2284
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2285
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2286
.B \f[CB]unchecked\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2287
Gives more detail for unchecked conversion warnings that are mandated by
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2288
the Java Language Specification, for example:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2289
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2290
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2291
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2292
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2293
List\ l\ =\ new\ ArrayList<Number>();
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2294
List<String>\ ls\ =\ l;\ \ \ \ \ \ \ //\ unchecked\ warning
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2295
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2296
.fi
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2297
.PP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2298
During type erasure, the types \f[CB]ArrayList<Number>\f[R] and
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2299
\f[CB]List<String>\f[R] become \f[CB]ArrayList\f[R] and \f[CB]List\f[R],
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2300
respectively.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2301
.PP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2302
The \f[CB]ls\f[R] command has the parameterized type
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2303
\f[CB]List<String>\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2304
When the \f[CB]List\f[R] referenced by \f[CB]l\f[R] is assigned to
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2305
\f[CB]ls\f[R], the compiler generates an unchecked warning.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2306
At compile time, the compiler and JVM cannot determine whether
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2307
\f[CB]l\f[R] refers to a \f[CB]List<String>\f[R] type.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2308
In this case, \f[CB]l\f[R] does not refer to a \f[CB]List<String>\f[R] type.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2309
As a result, heap pollution occurs.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2310
.PP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2311
A heap pollution situation occurs when the \f[CB]List\f[R] object
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2312
\f[CB]l\f[R], whose static type is \f[CB]List<Number>\f[R], is assigned to
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2313
another \f[CB]List\f[R] object, \f[CB]ls\f[R], that has a different static
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2314
type, \f[CB]List<String>\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2315
However, the compiler still allows this assignment.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2316
It must allow this assignment to preserve backward compatibility with
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2317
releases of Java SE that do not support generics.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2318
Because of type erasure, \f[CB]List<Number>\f[R] and \f[CB]List<String>\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2319
both become \f[CB]List\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2320
Consequently, the compiler allows the assignment of the object
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2321
\f[CB]l\f[R], which has a raw type of \f[CB]List\f[R], to the object
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2322
\f[CB]ls\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2323
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2324
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2325
.B \f[CB]varargs\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2326
Warns about unsafe use of variable arguments (\f[CB]varargs\f[R]) methods,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2327
in particular, those that contain non\-reifiable arguments, for example:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2328
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2329
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2330
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2331
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2332
public\ class\ ArrayBuilder\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2333
\ \ public\ static\ <T>\ void\ addToList\ (List<T>\ listArg,\ T...\ elements)\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2334
\ \ \ \ for\ (T\ x\ :\ elements)\ {
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2335
\ \ \ \ \ \ listArg.add(x);
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2336
\ \ \ \ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2337
\ \ }
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2338
}
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2339
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2340
.fi
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2341
.PP
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2342
A non\-reifiable type is a type whose type information is not fully
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2343
available at runtime.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2344
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2345
The compiler generates the following warning for the definition of the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2346
method \f[CB]ArrayBuilder.addToList\f[R]:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2347
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2348
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2349
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2350
warning:\ [varargs]\ Possible\ heap\ pollution\ from\ parameterized\ vararg\ type\ T
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2351
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2352
.fi
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
  2353
.PP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2354
When the compiler encounters a varargs method, it translates the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2355
\f[CB]varargs\f[R] formal parameter into an array.
55666
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2356
However, the Java programming language does not permit the creation of
340d73f42b3c 8227602: Update nroff version of man pages
jjg
parents: 55140
diff changeset
  2357
arrays of parameterized types.
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2358
In the method \f[CB]ArrayBuilder.addToList\f[R], the compiler translates
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2359
the \f[CB]varargs\f[R] formal parameter \f[CB]T...\f[R] elements to the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2360
formal parameter \f[CB]T[]\f[R] elements, an array.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2361
However, because of type erasure, the compiler converts the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2362
\f[CB]varargs\f[R] formal parameter to \f[CB]Object[]\f[R] elements.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2363
Consequently, there\[aq]s a possibility of heap pollution.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
  2364
.RE