src/linux/doc/man/javac.1
author aph
Fri, 19 Jan 2018 16:57:56 +0000
changeset 48701 48ce4b11bc17
parent 47216 71c04702a3d5
child 49424 4269e701448e
permissions -rw-r--r--
8195685: AArch64: AArch64 cannot build with JDK-8174962 Reviewed-by: adinn, njian
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
     1
'\" t
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     2
.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     3
.\" 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
     4
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     5
.\" 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
     6
.\" 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
     7
.\" published by the Free Software Foundation.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     8
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     9
.\" 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
    10
.\" 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
    11
.\" 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
    12
.\" 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
    13
.\" accompanied this code).
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    14
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    15
.\" 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
    16
.\" 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
    17
.\" 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
    18
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    19
.\" 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
    20
.\" 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
    21
.\" questions.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    22
.\"
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    23
.\"     Arch: generic
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    24
.\"     Software: JDK 8
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    25
.\"     Date: 03 March 2015
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    26
.\"     SectDesc: Basic Tools
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    27
.\"     Title: javac.1
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    28
.\"
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    29
.if n .pl 99999
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    30
.TH javac 1 "03 March 2015" "JDK 8" "Basic Tools"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    31
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    32
.\" * Define some portability stuff
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    33
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    34
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    35
.\" http://bugs.debian.org/507673
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    36
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    37
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    38
.ie \n(.g .ds Aq \(aq
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    39
.el       .ds Aq '
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    40
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    41
.\" * set default formatting
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    42
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    43
.\" disable hyphenation
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    44
.nh
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    45
.\" disable justification (adjust text to left margin only)
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    46
.ad l
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    47
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    48
.\" * MAIN CONTENT STARTS HERE *
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    49
.\" -----------------------------------------------------------------
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    51
.SH NAME    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    52
javac \- Reads Java class and interface definitions and compiles them into bytecode and class files\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    53
.SH SYNOPSIS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    54
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    55
.nf     
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    57
\fBjavac\fR [ \fIoptions\fR ] [ \fIsourcefiles\fR ] [ \fIclasses\fR] [ \fI@argfiles\fR ]
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    58
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    59
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    60
Arguments can be in any order:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    61
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    62
\fIoptions\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    63
Command-line options\&. See Options\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    64
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    65
\fIsourcefiles\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    66
One or more source files to be compiled (such as \f3MyClass\&.java\fR)\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    67
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    68
\fIclasses\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    69
One or more classes to be processed for annotations (such as \f3MyPackage\&.MyClass\fR)\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    70
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    71
\fI@argfiles\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    72
One or more files that list options and source files\&. The \f3-J\fR options are not allowed in these files\&. See Command-Line Argument Files\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    73
.SH DESCRIPTION    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    74
The \f3javac\fR command reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files\&. The \f3javac\fR command can also process annotations in Java source files and classes\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    75
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    76
There are two ways to pass source code file names to \f3javac\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    77
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    78
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    79
For a small number of source files, list the file names on the command line\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    80
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    81
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    82
For a large number of source files, list the file names in a file that is separated by blanks or line breaks\&. Use the list file name preceded by an at sign (@) with the \f3javac\fR command\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    83
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    84
Source code file names must have \&.java suffixes, class file names must have \&.class suffixes, and both source and class files must have root names that identify the class\&. For example, a class called \f3MyClass\fR would be written in a source file called \f3MyClass\&.java\fR and compiled into a bytecode class file called \f3MyClass\&.class\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    85
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    86
Inner class definitions produce additional class files\&. These class files have names that combine the inner and outer class names, such as \f3MyClass$MyInnerClass\&.class\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    87
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    88
Arrange source files in a directory tree that reflects their package tree\&. For example, if all of your source files are in \f3/workspace\fR, then put the source code for \f3com\&.mysoft\&.mypack\&.MyClass\fR in \f3/workspace/com/mysoft/mypack/MyClass\&.java\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    89
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    90
By default, the compiler puts each class file in the same directory as its source file\&. You can specify a separate destination directory with the \f3-d\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    91
.SH OPTIONS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    92
The compiler has a set of standard options that are supported on the current development environment\&. An additional set of nonstandard options are specific to the current virtual machine and compiler implementations and are subject to change in the future\&. Nonstandard options begin with the \f3-X\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    93
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    94
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    95
See also Cross-Compilation Options
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    96
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    97
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    98
See also Nonstandard Options
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    99
.SS STANDARD\ OPTIONS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   100
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   101
-A\fIkey\fR[\fI=value\fR]
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   102
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   103
Specifies options to pass to annotation processors\&. These options are not interpreted by \f3javac\fR directly, but are made available for use by individual processors\&. The \f3key\fR value should be one or more identifiers separated by a dot (\&.)\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   104
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   105
-cp \fIpath\fR or -classpath \fIpath\fR
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   106
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   107
Specifies where to find user class files, and (optionally) annotation processors and source files\&. This class path overrides the user class path in the \f3CLASSPATH\fR environment variable\&. If neither \f3CLASSPATH\fR, \f3-cp\fR nor \f3-classpath\fR is specified, then the user \fIclass path\fR is the current directory\&. See Setting the Class Path\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   108
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   109
If the \f3-sourcepath\fR option is not specified, then the user class path is also searched for source files\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   110
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   111
If the \f3-processorpath\fR option is not specified, then the class path is also searched for annotation processors\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   112
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   113
-Djava\&.ext\&.dirs=\fIdirectories\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   114
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   115
Overrides the location of installed extensions\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   116
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   117
-Djava\&.endorsed\&.dirs=\fIdirectories\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   118
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   119
Overrides the location of the endorsed standards path\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   120
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   121
-d \fIdirectory\fR
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   122
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   123
Sets the destination directory for class files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then \f3javac\fR puts the class file in a subdirectory that reflects the package name and creates directories as needed\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   124
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   125
If you specify \f3-d\fR\f3/home/myclasses\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the class file is \f3/home/myclasses/com/mypackage/MyClass\&.class\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   126
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   127
If the \fI-d\fR option is not specified, then \f3javac\fR puts each class file in the same directory as the source file from which it was generated\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   128
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   129
\fINote:\fR The directory specified by the \fI-d\fR option is not automatically added to your user class path\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   130
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   131
-deprecation
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   132
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   133
Shows a description of each use or override of a deprecated member or class\&. Without the \f3-deprecation\fR option, \f3javac\fR shows a summary of the source files that use or override deprecated members or classes\&. The \f3-deprecation\fR option is shorthand for \f3-Xlint:deprecation\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   134
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   135
-encoding \fIencoding\fR
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   136
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   137
Sets the source file encoding name, such as EUC-JP and UTF-8\&. If the \f3-encoding\fR option is not specified, then the platform default converter is used\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   138
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   139
-endorseddirs \fIdirectories\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   140
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   141
Overrides the location of the endorsed standards path\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   142
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   143
-extdirs \fIdirectories\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   144
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   145
Overrides the location of the \f3ext\fR directory\&. The directories variable is a colon-separated list of directories\&. Each JAR file in the specified directories is searched for class files\&. All JAR files found become part of the class path\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   146
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   147
If you are cross-compiling (compiling classes against bootstrap and extension classes of a different Java platform implementation), then this option specifies the directories that contain the extension classes\&. See Cross-Compilation Options for more information\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   148
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   149
-g
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   150
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   151
Generates all debugging information, including local variables\&. By default, only line number and source file information is generated\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   152
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   153
-g:none
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   154
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   155
Does not generate any debugging information\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   156
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   157
-g:[\fIkeyword list\fR]
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   158
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   159
Generates only some kinds of debugging information, specified by a comma separated list of keywords\&. Valid keywords are:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   160
.RS     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   161
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   162
source
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   163
Source file debugging information\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   164
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   165
lines
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   166
Line number debugging information\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   167
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   168
vars
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   169
Local variable debugging information\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   170
.RE     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   171
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   172
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   173
-help
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   174
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   175
Prints a synopsis of standard options\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   176
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   177
-implicit:[\fIclass, none\fR]
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   178
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   179
Controls the generation of class files for implicitly loaded source files\&. To automatically generate class files, use \f3-implicit:class\fR\&. To suppress class file generation, use \f3-implicit:none\fR\&. If this option is not specified, then the default is to automatically generate class files\&. In this case, the compiler issues a warning if any such class files are generated when also doing annotation processing\&. The warning is not issued when the \f3-implicit\fR option is set explicitly\&. See Searching for Types\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   180
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   181
-J\fIoption\fR
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   182
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   183
Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   185
\fINote:\fR The \fICLASSPATH\fR, \f3-classpath\fR, \f3-bootclasspath\fR, and \f3-extdirs\fR options do not specify the classes used to run \f3javac\fR\&. Trying to customize the compiler implementation with these options and variables is risky and often does not accomplish what you want\&. If you must customize the complier implementation, then use the \f3-J\fR option to pass options through to the underlying \f3\fRJava launcher\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   186
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   187
-nowarn
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   188
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   189
Disables warning messages\&. This option operates the same as the \f3-Xlint:none\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   190
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   191
-parameters
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   192
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   193
Stores formal parameter names of constructors and methods in the generated class file so that the method \f3java\&.lang\&.reflect\&.Executable\&.getParameters\fR from the Reflection API can retrieve them\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   194
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   195
-proc: [\fInone\fR, \fIonly\fR]
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   196
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   197
Controls whether annotation processing and compilation are done\&. \f3-proc:none\fR means that compilation takes place without annotation processing\&. \f3-proc:only\fR means that only annotation processing is done, without any subsequent compilation\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   198
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   199
-processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.]
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   200
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   201
Names of the annotation processors to run\&. This bypasses the default discovery process\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   202
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   203
-processorpath \fIpath\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   204
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   205
Specifies where to find annotation processors\&. If this option is not used, then the class path is searched for processors\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   206
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   207
-s \fIdir\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   208
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   209
Specifies the directory where to place the generated source files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then the compiler puts the source file in a subdirectory that reflects the package name and creates directories as needed\&.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   211
If you specify \f3-s /home/mysrc\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the source file is put in \f3/home/mysrc/com/mypackage/MyClass\&.java\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   212
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   213
-source \fIrelease\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   214
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   215
Specifies the version of source code accepted\&. The following values for \f3release\fR are allowed:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   216
.RS     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   217
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   218
1\&.3
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   219
The compiler does not support assertions, generics, or other language features introduced after Java SE 1\&.3\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   220
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   221
1\&.4
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   222
The compiler accepts code containing assertions, which were introduced in Java SE 1\&.4\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   223
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   224
1\&.5
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   225
The compiler accepts code containing generics and other language features introduced in Java SE 5\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   226
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   227
5
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   228
Synonym for 1\&.5\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   229
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   230
1\&.6
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   231
No language changes were introduced in Java SE 6\&. However, encoding errors in source files are now reported as errors instead of warnings as in earlier releases of Java Platform, Standard Edition\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   232
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   233
6
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   234
Synonym for 1\&.6\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   235
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   236
1\&.7
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   237
The compiler accepts code with features introduced in Java SE 7\&.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   238
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   239
7
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   240
Synonym for 1\&.7\&.
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   241
.TP     
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   242
1\&.8
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   243
This is the default value\&. The compiler accepts code with features introduced in Java SE 8\&.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   244
.TP     
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   245
8
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   246
Synonym for 1\&.8\&.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   247
.RE     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   248
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   249
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   250
-sourcepath \fIsourcepath\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   251
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   252
Specifies the source code path to search for class or interface definitions\&. As with the user class path, source path entries are separated by colons (:) on Oracle Solaris and semicolons on Windows and can be directories, JAR archives, or ZIP archives\&. If packages are used, then the local path name within the directory or archive must reflect the package name\&.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   254
\fINote:\fR Classes found through the class path might be recompiled when their source files are also found\&. See Searching for Types\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   255
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   256
-verbose
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   257
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   258
Uses verbose output, which includes information about each class loaded and each source file compiled\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   259
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   260
-version
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   261
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   262
Prints release information\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   263
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   264
-werror
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   265
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   266
Terminates compilation when warnings occur\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   267
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   268
-X
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   269
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   270
Displays information about nonstandard options and exits\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   271
.SS CROSS-COMPILATION\ OPTIONS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   272
By default, classes are compiled against the bootstrap and extension classes of the platform that \f3javac\fR shipped with\&. But \f3javac\fR also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation\&. It is important to use the \f3-bootclasspath\fR and \f3-extdirs\fR options when cross-compiling\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   273
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   274
-target \fIversion\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   275
.br
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   276
Generates class files that target a specified release of the virtual machine\&. Class files will run on the specified target and on later releases, but not on earlier releases of the JVM\&. Valid targets are 1\&.1, 1\&.2, 1\&.3, 1\&.4, 1\&.5 (also 5), 1\&.6 (also 6), 1\&.7 (also 7), and 1\&.8 (also 8)\&.
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   277
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   278
The default for the \f3-target\fR option depends on the value of the \f3-source\fR option:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   279
.RS     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   280
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   281
\(bu
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   282
If the \f3-source\fR option is not specified, then the value of the \f3-target\fR option is 1\&.8
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   283
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   284
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   285
If the \f3-source\fR option is 1\&.2, then the value of the \f3-target\fR option is 1\&.4
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   286
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   287
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   288
If the \f3-source\fR option is 1\&.3, then the value of the \f3-target\fR option is 1\&.4
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   289
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   290
\(bu
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   291
If the \f3-source\fR option is 1\&.5, then the value of the \f3-target\fR option is 1\&.8
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   292
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   293
\(bu
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   294
If the \f3-source\fR option is 1\&.6, then the value of the \f3-target\fR is option 1\&.8
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   295
.TP 0.2i    
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   296
\(bu
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   297
If the \f3-source\fR option is 1\&.7, then the value of the \f3-target\fR is option 1\&.8
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   298
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   299
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   300
For all other values of the \f3-source\fR option, the value of the \f3-target\fR option is the value of the \f3-source\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   301
.RE     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   302
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   303
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   304
-bootclasspath \fIbootclasspath\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   305
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   306
Cross-compiles against the specified set of boot classes\&. As with the user class path, boot class path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   307
.SS COMPACT\ PROFILE\ OPTION    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   308
Beginning with JDK 8, the \f3javac\fR compiler supports compact profiles\&. With compact profiles, applications that do not require the entire Java platform can be deployed and run with a smaller footprint\&. The compact profiles feature could be used to shorten the download time for applications from app stores\&. This feature makes for more compact deployment of Java applications that bundle the JRE\&. This feature is also useful in small devices\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   309
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   310
The supported profile values are \f3compact1\fR, \f3compact2\fR, and \f3compact3\fR\&. These are additive layers\&. Each higher-numbered compact profile contains all of the APIs in profiles with smaller number names\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   311
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   312
-profile
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   313
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   314
When using compact profiles, this option specifies the profile name when compiling\&. For example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   315
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   316
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   317
\f3javac \-profile compact1 Hello\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   318
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   319
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   320
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   321
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   322
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   323
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   324
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   325
javac does not compile source code that uses any Java SE APIs that is not in the specified profile\&. Here is an example of the error message that results from attempting to compile such source code:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   326
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   327
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   328
\f3cd jdk1\&.8\&.0/bin\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   329
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   330
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   331
\f3\&./javac \-profile compact1 Paint\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   332
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   333
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   334
\f3Paint\&.java:5: error: Applet is not available in profile \&'compact1\&'\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   335
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   336
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   337
\f3import java\&.applet\&.Applet;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   338
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   339
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   340
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   341
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   342
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   343
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   344
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   345
In this example, you can correct the error by modifying the source to not use the \f3Applet\fR class\&. You could also correct the error by compiling without the -profile option\&. Then the compilation would be run against the full set of Java SE APIs\&. (None of the compact profiles include the \f3Applet\fR class\&.)
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   346
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   347
An alternative way to compile with compact profiles is to use the \f3-bootclasspath\fR option to specify a path to an \f3rt\&.jar\fR file that specifies a profile\&'s image\&. Using the \f3-profile\fR option instead does not require a profile image to be present on the system at compile time\&. This is useful when cross-compiling\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   348
.SS NONSTANDARD\ OPTIONS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   349
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   350
-Xbootclasspath/p:\fIpath\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   351
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   352
Adds a suffix to the bootstrap class path\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   353
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   354
-Xbootclasspath/a:\fIpath\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   355
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   356
Adds a prefix to the bootstrap class path\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   357
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   358
-Xbootclasspath/:\fIpath\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   359
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   360
Overrides the location of the bootstrap class files\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   361
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   362
-Xdoclint:[-]\fIgroup\fR [\fI/access\fR]
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   363
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   364
Enables or disables specific groups of checks, where \fIgroup\fR is one of the following values: \f3accessibility\fR, \f3syntax\fR, \f3reference\fR, \f3html\fR or \f3missing\fR\&. For more information about these groups of checks see the \f3-Xdoclint\fR option of the \f3javadoc\fR command\&. The \f3-Xdoclint\fR option is disabled by default in the \f3javac\fR command\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   365
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   366
The variable \fIaccess\fR specifies the minimum visibility level of classes and members that the \f3-Xdoclint\fR option checks\&. It can have one of the following values (in order of most to least visible) : \f3public\fR, \f3protected\fR, \f3package\fR and \f3private\fR\&. For example, the following option checks classes and members (with all groups of checks) that have the access level protected and higher (which includes protected, package and public):
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   367
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   368
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   369
\f3\-Xdoclint:all/protected\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   370
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   371
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   372
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   373
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   374
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   375
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   376
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   377
The following option enables all groups of checks for all access levels, except it will not check for HTML errors for classes and members that have access level package and higher (which includes package and public):
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   378
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   379
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   380
\f3\-Xdoclint:all,\-html/package\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   381
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   382
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   383
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   384
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   385
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   386
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   387
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   388
-Xdoclint:none
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   389
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   390
Disables all groups of checks\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   391
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   392
-Xdoclint:all[\fI/access\fR]
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   393
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   394
Enables all groups of checks\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   395
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   396
-Xlint
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   397
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   398
\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   399
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   400
-Xlint:all
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   401
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   402
\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   403
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   404
-Xlint:none
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   405
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   406
Disables all warnings\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   407
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   408
-Xlint:\fIname\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   409
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   410
Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option for a list of warnings you can disable with this option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   411
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   412
-Xlint:\fI-name\fR
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   413
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   414
Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option with the \f3-Xlint\fR option to get a list of warnings that you can disable with this option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   415
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   416
-Xmaxerrs \fInumber\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   417
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   418
Sets the maximum number of errors to print\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   419
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   420
-Xmaxwarns \fInumber\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   421
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   422
Sets the maximum number of warnings to print\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   423
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   424
-Xstdout \fIfilename\fR
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   425
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   426
Sends compiler messages to the named file\&. By default, compiler messages go to \f3System\&.err\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   427
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   428
-Xprefer:[\fInewer,source\fR]
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   429
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   430
Specifies which file to read when both a source file and class file are found for a type\&. (See Searching for Types)\&. If the \f3-Xprefer:newer\fR option is used, then it reads the newer of the source or class file for a type (default)\&. If the \f3-Xprefer:source\fR option is used, then it reads the source file\&. Use -\f3Xprefer:source\fR when you want to be sure that any annotation processors can access annotations declared with a retention policy of \f3SOURCE\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   431
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   432
-Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR]
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   433
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   434
Control whether javac generates \f3package-info\&.class\fR files from package-info\&.java files\&. Possible mode arguments for this option include the following\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   435
.RS     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   436
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   437
always
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   438
Always generate a \f3package-info\&.class\fR file for every \f3package-info\&.java\fR file\&. This option may be useful if you use a build system such as Ant, which checks that each \f3\&.java\fR file has a corresponding \f3\&.class\fR file\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   439
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   440
legacy
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   441
Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations\&. Don\&'t generate a \f3package-info\&.class\fR file if package-info\&.java only contains comments\&.
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   442
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   443
\fINote:\fR A \f3package-info\&.class\fR file might be generated but be empty if all the annotations in the package-info\&.java file have \f3RetentionPolicy\&.SOURCE\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   444
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   445
nonempty
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   446
Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations with \f3RetentionPolicy\&.CLASS\fR or \f3RetentionPolicy\&.RUNTIME\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   447
.RE     
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   448
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   449
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   450
-Xprint
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   451
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   452
Prints a textual representation of specified types for debugging purposes\&. Perform neither annotation processing nor compilation\&. The format of the output could change\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   453
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   454
-XprintProcessorInfo
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   455
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   456
Prints information about which annotations a processor is asked to process\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   457
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   458
-XprintRounds
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   459
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   460
Prints information about initial and subsequent annotation processing rounds\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   461
.SH ENABLE\ OR\ DISABLE\ WARNINGS\ WITH\ THE\ -XLINT\ OPTION    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   462
Enable warning \fIname\fR with the \f3-Xlint:name\fR option, where \f3name\fR is one of the following warning names\&. Note that you can disable a warning with the \f3-Xlint:-name:\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   463
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   464
cast
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   465
Warns about unnecessary and redundant casts, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   466
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   467
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   468
\f3String s = (String) "Hello!"\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   469
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   470
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   471
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   472
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   473
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   474
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   475
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   476
classfile
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   477
Warns about issues related to class file contents\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   478
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   479
deprecation
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   480
Warns about the use of deprecated items, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   481
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   482
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   483
\f3java\&.util\&.Date myDate = new java\&.util\&.Date();\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   484
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   485
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   486
\f3int currentDay = myDate\&.getDay();\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   487
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   488
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   489
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   490
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   491
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   492
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   493
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   494
The method \f3java\&.util\&.Date\&.getDay\fR has been deprecated since JDK 1\&.1
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   495
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   496
dep-ann
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   497
Warns about items that are documented with an \f3@deprecated\fR Javadoc comment, but do not have a \f3@Deprecated\fR annotation, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   498
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   499
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   500
\f3/**\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   501
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   502
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   503
\f3  * @deprecated As of Java SE 7, replaced by {@link #newMethod()}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   504
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   505
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   506
\f3  */\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   507
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   508
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   509
\f3public static void deprecatedMethood() { }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   510
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   511
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   512
\f3public static void newMethod() { }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   513
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   514
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   515
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   516
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   517
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   518
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   519
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   520
divzero
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   521
Warns about division by the constant integer 0, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   522
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   523
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   524
\f3int divideByZero = 42 / 0;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   525
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   526
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   527
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   528
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   529
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   530
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   531
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   532
empty
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   533
Warns about empty statements after \f3if\fRstatements, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   534
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   535
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   536
\f3class E {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   537
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   538
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   539
\f3    void m() {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   540
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   541
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   542
\f3         if (true) ;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   543
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   544
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   545
\f3    }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   546
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   547
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   548
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   549
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   550
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   551
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   552
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   553
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   554
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   555
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   556
fallthrough
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   557
Checks the switch blocks for fall-through cases and provides a warning message for any that are found\&. Fall-through cases are cases in a switch block, other than the last case in the block, whose code does not include a break statement, allowing code execution to fall through from that case to the next case\&. For example, the code following the case 1 label in this switch block does not end with a break statement:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   558
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   559
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   560
\f3switch (x) {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   561
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   562
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   563
\f3case 1:\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   564
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   565
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   566
\f3  System\&.out\&.println("1");\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   567
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   568
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   569
\f3  // No break statement here\&.\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   570
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   571
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   572
\f3case 2:\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   573
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   574
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   575
\f3  System\&.out\&.println("2");\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   576
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   577
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   578
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   579
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   580
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   581
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   582
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   583
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   584
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   585
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   586
If the \f3-Xlint:fallthrough\fR option was used when compiling this code, then the compiler emits a warning about possible fall-through into case, with the line number of the case in question\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   587
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   588
finally
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   589
Warns about \f3finally\fR clauses that cannot complete normally, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   590
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   591
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   592
\f3public static int m() {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   593
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   594
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   595
\f3  try {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   596
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   597
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   598
\f3     throw new NullPointerException();\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   599
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   600
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   601
\f3  }  catch (NullPointerException(); {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   602
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   603
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   604
\f3     System\&.err\&.println("Caught NullPointerException\&.");\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   605
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   606
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   607
\f3     return 1;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   608
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   609
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   610
\f3   } finally {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   611
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   612
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   613
\f3     return 0;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   614
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   615
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   616
\f3   }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   617
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   618
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   619
\f3  }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   620
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   621
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   622
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   623
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   624
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   625
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   626
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   627
The compiler generates a warning for the \f3finally\fR block in this example\&. When the \f3int\fR method is called, it returns a value of 0\&. A \f3finally\fR block executes when the \f3try\fR block exits\&. In this example, when control is transferred to the \f3catch\fR block, the \f3int\fR method exits\&. However, the \f3finally\fR block must execute, so it is executed, even though control was transferred outside the method\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   628
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   629
options
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   630
Warns about issues that related to the use of command-line options\&. See Cross-Compilation Options\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   631
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   632
overrides
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   633
Warns about issues regarding method overrides\&. For example, consider the following two classes:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   634
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   635
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   636
\f3public class ClassWithVarargsMethod {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   637
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   638
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   639
\f3  void varargsMethod(String\&.\&.\&. s) { }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   640
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   641
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   642
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   643
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   644
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   645
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   646
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   647
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   648
\f3public class ClassWithOverridingMethod extends ClassWithVarargsMethod {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   649
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   650
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   651
\f3   @Override\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   652
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   653
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   654
\f3   void varargsMethod(String[] s) { }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   655
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   656
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   657
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   658
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   659
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   660
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   661
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   662
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   663
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   664
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   665
The compiler generates a warning similar to the following:\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   666
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   667
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   668
\f3warning: [override] varargsMethod(String[]) in ClassWithOverridingMethod \fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   669
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   670
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   671
\f3overrides varargsMethod(String\&.\&.\&.) in ClassWithVarargsMethod; overriding\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   672
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   673
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   674
\f3method is missing \&'\&.\&.\&.\&'\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   675
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   676
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   677
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   678
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   679
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   680
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   681
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   682
When the compiler encounters a \f3varargs\fR method, it translates the \f3varargs\fR formal parameter into an array\&. In the method \f3ClassWithVarargsMethod\&.varargsMethod\fR, the compiler translates the \f3varargs\fR formal parameter \f3String\&.\&.\&. s\fR to the formal parameter \f3String[] s\fR, an array, which matches the formal parameter of the method \f3ClassWithOverridingMethod\&.varargsMethod\fR\&. Consequently, this example compiles\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   683
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   684
path
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   685
Warns about invalid path elements and nonexistent path directories on the command line (with regard to the class path, the source path, and other paths)\&. Such warnings cannot be suppressed with the \f3@SuppressWarnings\fR annotation, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   686
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   687
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   688
\f3javac \-Xlint:path \-classpath /nonexistentpath Example\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   689
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   690
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   691
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   692
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   693
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   694
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   695
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   696
processing
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   697
Warn about issues regarding annotation processing\&. The compiler generates this warning when you have a class that has an annotation, and you use an annotation processor that cannot handle that type of exception\&. For example, the following is a simple annotation processor:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   698
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   699
\fISource file AnnocProc\&.java\fR:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   700
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   701
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   702
\f3import java\&.util\&.*;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   703
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   704
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   705
\f3import javax\&.annotation\&.processing\&.*;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   706
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   707
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   708
\f3import javax\&.lang\&.model\&.*;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   709
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   710
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   711
\f3import\&.javaz\&.lang\&.model\&.element\&.*;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   712
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   713
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   714
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   715
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   716
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   717
\f3@SupportedAnnotationTypes("NotAnno")\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   718
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   719
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   720
\f3public class AnnoProc extends AbstractProcessor {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   721
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   722
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   723
\f3  public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv){\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   724
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   725
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   726
\f3     return true;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   727
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   728
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   729
\f3  }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   730
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   731
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   732
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   733
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   734
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   735
\f3  public SourceVersion getSupportedSourceVersion() {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   736
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   737
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   738
\f3     return SourceVersion\&.latest();\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   739
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   740
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   741
\f3   }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   742
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   743
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   744
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   745
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   746
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   747
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   748
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   749
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   750
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   751
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   752
\fISource file AnnosWithoutProcessors\&.java\fR:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   753
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   754
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   755
\f3@interface Anno { }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   756
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   757
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   758
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   759
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   760
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   761
\f3@Anno\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   762
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   763
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   764
\f3class AnnosWithoutProcessors { }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   765
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   766
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   767
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   768
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   769
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   770
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   771
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   772
The following commands compile the annotation processor \f3AnnoProc\fR, then run this annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   773
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   774
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   775
\f3javac AnnoProc\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   776
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   777
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   778
\f3javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutProcessors\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   779
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   780
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   781
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   782
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   783
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   784
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   785
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   786
When the compiler runs the annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR, it generates the following warning:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   787
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   788
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   789
\f3warning: [processing] No processor claimed any of these annotations: Anno\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   790
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   791
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   792
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   793
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   794
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   795
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   796
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   797
To resolve this issue, you can rename the annotation defined and used in the class \f3AnnosWithoutProcessors\fR from \f3Anno\fR to \f3NotAnno\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   798
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   799
rawtypes
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   800
Warns about unchecked operations on raw types\&. The following statement generates a \f3rawtypes\fR warning:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   801
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   802
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   803
\f3void countElements(List l) { \&.\&.\&. }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   804
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   805
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   806
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   807
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   808
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   809
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   810
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   811
The following example does not generate a \f3rawtypes\fR warning
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   812
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   813
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   814
\f3void countElements(List<?> l) { \&.\&.\&. }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   815
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   816
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   817
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   818
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   819
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   820
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   821
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   822
\f3List\fR is a raw type\&. However, \f3List<?>\fR is an unbounded wildcard parameterized type\&. Because \f3List\fR is a parameterized interface, always specify its type argument\&. In this example, the \f3List\fR formal argument is specified with an unbounded wildcard (\f3?\fR) as its formal type parameter, which means that the \f3countElements\fR method can accept any instantiation of the \f3List\fR interface\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   823
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   824
Serial
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   825
Warns about missing \f3serialVersionUID\fR definitions on serializable classes, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   826
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   827
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   828
\f3public class PersistentTime implements Serializable\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   829
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   830
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   831
\f3{\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   832
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   833
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   834
\f3  private Date time;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   835
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   836
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   837
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   838
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   839
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   840
\f3   public PersistentTime() {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   841
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   842
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   843
\f3     time = Calendar\&.getInstance()\&.getTime();\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   844
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   845
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   846
\f3   }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   847
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   848
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   849
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   850
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   851
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   852
\f3   public Date getTime() {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   853
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   854
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   855
\f3     return time;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   856
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   857
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   858
\f3   }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   859
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   860
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   861
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   862
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   863
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   864
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   865
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   866
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   867
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   868
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   869
The compiler generates the following warning:
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   870
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   871
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   872
\f3warning: [serial] serializable class PersistentTime has no definition of\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   873
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   874
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   875
\f3serialVersionUID\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   876
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   877
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   878
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   879
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   880
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   881
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   883
If a serializable class does not explicitly declare a field named \f3serialVersionUID\fR, then the serialization runtime environment calculates a default \f3serialVersionUID\fR value for that class based on various aspects of the class, as described in the Java Object Serialization Specification\&. However, it is strongly recommended that all serializable classes explicitly declare \f3serialVersionUID\fR values because the default process of computing \f3serialVersionUID\fR vales is highly sensitive to class details that can vary depending on compiler implementations, and as a result, might cause an unexpected \f3InvalidClassExceptions\fR during deserialization\&. To guarantee a consistent \f3serialVersionUID\fR value across different Java compiler implementations, a serializable class must declare an explicit \f3serialVersionUID\fR value\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   884
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   885
static
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   886
Warns about issues relating to the use of statics, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   887
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   888
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   889
\f3class XLintStatic {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   890
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   891
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   892
\f3    static void m1() { }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   893
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   894
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   895
\f3    void m2() { this\&.m1(); }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   896
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   897
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   898
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   899
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   900
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   901
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   902
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   903
.sp     
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   906
The compiler generates the following warning:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   907
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   908
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   909
\f3warning: [static] static method should be qualified by type name, \fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   910
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   911
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   912
\f3XLintStatic, instead of by an expression\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   913
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   914
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   915
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   916
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   917
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   918
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   919
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   920
To resolve this issue, you can call the \f3static\fR method \f3m1\fR as follows:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   921
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   922
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   923
\f3XLintStatic\&.m1();\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   924
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   925
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   926
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   927
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   928
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   929
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   930
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   931
Alternately, you can remove the \f3static\fR keyword from the declaration of the method \f3m1\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   932
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   933
try
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   934
Warns about issues relating to use of \f3try\fR blocks, including try-with-resources statements\&. For example, a warning is generated for the following statement because the resource \f3ac\fR declared in the \f3try\fR block is not used:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   935
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   936
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   937
\f3try ( AutoCloseable ac = getResource() ) {    // do nothing}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   938
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   939
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   940
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   941
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   942
.sp     
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   943
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   944
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   945
unchecked
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   946
Gives more detail for unchecked conversion warnings that are mandated by the Java Language Specification, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   947
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   948
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   949
\f3List l = new ArrayList<Number>();\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   950
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   951
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   952
\f3List<String> ls = l;       // unchecked warning\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   953
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   954
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   955
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   956
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   957
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   958
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   959
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   960
During type erasure, the types \f3ArrayList<Number>\fR and \f3List<String>\fR become \f3ArrayList\fR and \f3List\fR, respectively\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   961
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   962
The \f3ls\fR command has the parameterized type \f3List<String>\fR\&. When the \f3List\fR referenced by \f3l\fR is assigned to \f3ls\fR, the compiler generates an unchecked warning\&. At compile time, the compiler and JVM cannot determine whether \f3l\fR refers to a \f3List<String>\fR type\&. In this case, \f3l\fR does not refer to a \f3List<String>\fR type\&. As a result, heap pollution occurs\&.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   964
A heap pollution situation occurs when the \f3List\fR object \f3l\fR, whose static type is \f3List<Number>\fR, is assigned to another \f3List\fR object, \f3ls\fR, that has a different static type, \f3List<String>\fR\&. However, the compiler still allows this assignment\&. It must allow this assignment to preserve backward compatibility with releases of Java SE that do not support generics\&. Because of type erasure, \f3List<Number>\fR and \f3List<String>\fR both become \f3List\fR\&. Consequently, the compiler allows the assignment of the object \f3l\fR\f3,\fR which has a raw type of \f3List\fR, to the object \f3ls\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   965
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   966
varargs
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   967
Warns about unsafe usages of variable arguments (\f3varargs\fR) methods, in particular, those that contain non-reifiable arguments, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   968
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   969
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   970
\f3public class ArrayBuilder {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   971
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   972
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   973
\f3  public static <T> void addToList (List<T> listArg, T\&.\&.\&. elements) {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   974
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   975
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   976
\f3    for (T x : elements) {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   977
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   978
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   979
\f3      listArg\&.add(x);\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   980
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   981
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   982
\f3    }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   983
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   984
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   985
\f3  }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   986
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   987
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   988
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   989
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   990
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   991
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   992
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   993
.sp     
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   995
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   996
\fINote:\fR A non-reifiable type is a type whose type information is not fully available at runtime\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   997
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   998
The compiler generates the following warning for the definition of the method \f3ArrayBuilder\&.addToList\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   999
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1000
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1001
\f3warning: [varargs] Possible heap pollution from parameterized vararg type T\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1002
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1003
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1004
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1005
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1006
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1007
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1009
When the compiler encounters a varargs method, it translates the \f3varargs\fR formal parameter into an array\&. However, the Java programming language does not permit the creation of arrays of parameterized types\&. In the method \f3ArrayBuilder\&.addToList\fR, the compiler translates the \f3varargs\fR formal parameter \f3T\&.\&.\&.\fR elements to the formal parameter \f3T[]\fR elements, an array\&. However, because of type erasure, the compiler converts the \f3varargs\fR formal parameter to \f3Object[]\fR elements\&. Consequently, there is a possibility of heap pollution\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1010
.SH COMMAND-LINE\ ARGUMENT\ FILES    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1011
To shorten or simplify the \f3javac\fR command, you can specify one or more files that contain arguments to the \f3javac\fR command (except \f3-J\fR options)\&. This enables you to create \f3javac\fR commands of any length on any operating system\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1012
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1013
An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be separated by spaces or new line characters\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1014
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1015
File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (*) are not allowed in these lists (such as for specifying \f3*\&.java\fR)\&. Use of the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1016
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1017
When executing the \f3javac\fR command, pass in the path and name of each argument file with the at sign (@) leading character\&. When the \f3javac\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1018
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1019
\f3Example 1 Single Argument File\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1020
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1021
You could use a single argument file named \f3argfile\fR to hold all \f3javac\fR arguments:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1022
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1023
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1024
\f3javac @argfile\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1025
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1026
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1027
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1028
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1029
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1030
This argument file could contain the contents of both files shown in Example 2
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1031
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1032
\f3Example 2 Two Argument Files\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1033
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1034
You can create two argument files: one for the \f3javac\fR options and the other for the source file names\&. Note that the following lists have no line-continuation characters\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1035
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1036
Create a file named options that contains the following:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1037
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1038
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1039
\f3\-d classes\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1040
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1041
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1042
\f3\-g\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1043
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1044
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1045
\f3\-sourcepath /java/pubs/ws/1\&.3/src/share/classes\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1046
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1047
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1048
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1049
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1050
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1051
Create a file named classes that contains the following:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1052
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1053
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1054
\f3MyClass1\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1055
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1056
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1057
\f3MyClass2\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1058
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1059
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1060
\f3MyClass3\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1061
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1062
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1063
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1064
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1065
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1066
Then, run the \f3javac\fR command as follows:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1067
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1068
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1069
\f3javac @options @classes\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1070
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1071
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1072
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1073
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1074
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1075
\f3Example 3 Argument Files with Paths\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1076
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1077
The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1078
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1079
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1080
\f3javac @path1/options @path2/classes\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1081
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1082
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1083
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1084
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1085
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1086
.SH ANNOTATION\ PROCESSING    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1087
The \f3javac\fR command provides direct support for annotation processing, superseding the need for the separate annotation processing command, \f3apt\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1088
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1089
The API for annotation processors is defined in the \f3javax\&.annotation\&.processing\fR and j\f3avax\&.lang\&.model\fR packages and subpackages\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1090
.SS HOW\ ANNOTATION\ PROCESSING\ WORKS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1091
Unless annotation processing is disabled with the \f3-proc:none\fR option, the compiler searches for any annotation processors that are available\&. The search path can be specified with the \f3-processorpath\fR option\&. If no path is specified, then the user class path is used\&. Processors are located by means of service provider-configuration files named \f3META-INF/services/javax\&.annotation\&.processing\fR\&.Processor on the search path\&. Such files should contain the names of any annotation processors to be used, listed one per line\&. Alternatively, processors can be specified explicitly, using the \f3-processor\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1092
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1093
After scanning the source files and classes on the command line to determine what annotations are present, the compiler queries the processors to determine what annotations they process\&. When a match is found, the processor is called\&. A processor can claim the annotations it processes, in which case no further attempt is made to find any processors for those annotations\&. After all of the annotations are claimed, the compiler does not search for additional processors\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1094
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1095
If any processors generate new source files, then another round of annotation processing occurs: Any newly generated source files are scanned, and the annotations processed as before\&. Any processors called on previous rounds are also called on all subsequent rounds\&. This continues until no new source files are generated\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1096
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1097
After a round occurs where no new source files are generated, the annotation processors are called one last time, to give them a chance to complete any remaining work\&. Finally, unless the \f3-proc:only\fR option is used, the compiler compiles the original and all generated source files\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1098
.SS IMPLICITLY\ LOADED\ SOURCE\ FILES    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1099
To compile a set of source files, the compiler might need to implicitly load additional source files\&. See Searching for Types\&. Such files are currently not subject to annotation processing\&. By default, the compiler gives a warning when annotation processing occurred and any implicitly loaded source files are compiled\&. The \f3-implicit\fR option provides a way to suppress the warning\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1100
.SH SEARCHING\ FOR\ TYPES    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1101
To compile a source file, the compiler often needs information about a type, but the type definition is not in the source files specified on the command line\&. The compiler needs type information for every class or interface used, extended, or implemented in the source file\&. This includes classes and interfaces not explicitly mentioned in the source file, but that provide information through inheritance\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1102
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1103
For example, when you create a subclass \f3java\&.applet\&.Applet\fR, you are also using the ancestor classes of \f3Applet\fR: \f3java\&.awt\&.Panel\fR, \f3java\&.awt\&.Container\fR, \f3java\&.awt\&.Component\fR, and \f3java\&.lang\&.Object\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1104
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1105
When the compiler needs type information, it searches for a source file or class file that defines the type\&. The compiler searches for class files first in the bootstrap and extension classes, then in the user class path (which by default is the current directory)\&. The user class path is defined by setting the \f3CLASSPATH\fR environment variable or by using the \f3-classpath\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1106
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1107
If you set the \f3-sourcepath\fR option, then the compiler searches the indicated path for source files\&. Otherwise, the compiler searches the user class path for both class files and source files\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1108
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1109
You can specify different bootstrap or extension classes with the \f3-bootclasspath\fR and the \f3-extdirs\fR options\&. See Cross-Compilation Options\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1110
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1111
A successful type search may produce a class file, a source file, or both\&. If both are found, then you can use the \f3-Xprefer\fR option to instruct the compiler which to use\&. If \f3newer\fR is specified, then the compiler uses the newer of the two files\&. If \f3source\fR is specified, the compiler uses the source file\&. The default is \f3newer\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1112
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1113
If a type search finds a source file for a required type, either by itself, or as a result of the setting for the \f3-Xprefer\fR option, then the compiler reads the source file to get the information it needs\&. By default the compiler also compiles the source file\&. You can use the \f3-implicit\fR option to specify the behavior\&. If \f3none\fR is specified, then no class files are generated for the source file\&. If \f3class\fR is specified, then class files are generated for the source file\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1114
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1115
The compiler might not discover the need for some type information until after annotation processing completes\&. When the type information is found in a source file and no \f3-implicit\fR option is specified, the compiler gives a warning that the file is being compiled without being subject to annotation processing\&. To disable the warning, either specify the file on the command line (so that it will be subject to annotation processing) or use the \f3-implicit\fR option to specify whether or not class files should be generated for such source files\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1116
.SH PROGRAMMATIC\ INTERFACE    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1117
The \f3javac\fR command supports the new Java Compiler API defined by the classes and interfaces in the \f3javax\&.tools\fR package\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1118
.SS EXAMPLE    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1119
To compile as though providing command-line arguments, use the following syntax:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1120
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1121
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1122
\f3JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler();\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1123
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1124
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1125
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1126
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1127
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1128
The example writes diagnostics to the standard output stream and returns the exit code that \f3javac\fR would give when called from the command line\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1129
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1130
You can use other methods in the \f3javax\&.tools\&.JavaCompiler\fR interface to handle diagnostics, control where files are read from and written to, and more\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1131
.SS OLD\ INTERFACE    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1132
\fINote:\fR This API is retained for backward compatibility only\&. All new code should use the newer Java Compiler API\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1133
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1134
The \f3com\&.sun\&.tools\&.javac\&.Main\fR class provides two static methods to call the compiler from a program:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1135
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1136
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1137
\f3public static int compile(String[] args);\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1138
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1139
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1140
\f3public static int compile(String[] args, PrintWriter out);\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1141
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1142
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1143
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1144
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1145
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1146
The \f3args\fR parameter represents any of the command-line arguments that would typically be passed to the compiler\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1147
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1148
The \f3out\fR parameter indicates where the compiler diagnostic output is directed\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1149
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1150
The \f3return\fR value is equivalent to the \f3exit\fR value from \f3javac\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1151
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1152
\fINote:\fR All other classes and methods found in a package with names that start with \f3com\&.sun\&.tools\&.javac\fR (subpackages of \f3com\&.sun\&.tools\&.javac\fR) are strictly internal and subject to change at any time\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1153
.SH EXAMPLES    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1154
\f3Example 1 Compile a Simple Program\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1155
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1156
This example shows how to compile the \f3Hello\&.java\fR source file in the greetings directory\&. The class defined in \f3Hello\&.java\fR is called \f3greetings\&.Hello\fR\&. The greetings directory is the package directory both for the source file and the class file and is underneath the current directory\&. This makes it possible to use the default user class path\&. It also makes it unnecessary to specify a separate destination directory with the \f3-d\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1157
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1158
The source code in \f3Hello\&.java\fR:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1159
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1160
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1161
\f3package greetings;\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1162
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1163
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1164
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1165
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1166
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1167
\f3public class Hello {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1168
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1169
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1170
\f3    public static void main(String[] args) {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1171
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1172
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1173
\f3        for (int i=0; i < args\&.length; i++) {\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1174
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1175
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1176
\f3            System\&.out\&.println("Hello " + args[i]);\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1177
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1178
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1179
\f3        }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1180
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1181
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1182
\f3    }\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1183
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1184
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1185
\f3}\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1186
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1187
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1188
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1189
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1190
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1191
Compile greetings\&.Hello:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1192
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1193
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1194
\f3javac greetings/Hello\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1195
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1196
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1197
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1198
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1199
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1200
Run \f3greetings\&.Hello\fR:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1201
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1202
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1203
\f3java greetings\&.Hello World Universe Everyone\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1204
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1205
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1206
\f3Hello World\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1207
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1208
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1209
\f3Hello Universe\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1210
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1211
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1212
\f3Hello Everyone\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1213
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1214
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1215
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1216
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1217
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1218
\f3Example 2 Compile Multiple Source Files\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1219
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1220
This example compiles the \f3Aloha\&.java\fR, \f3GutenTag\&.java\fR, \f3Hello\&.java\fR, and \f3Hi\&.java\fR source files in the \f3greetings\fR package\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1221
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1222
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1223
\f3% javac greetings/*\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1224
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1225
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1226
\f3% ls greetings\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1227
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1228
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1229
\f3Aloha\&.class         GutenTag\&.class      Hello\&.class         Hi\&.class\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1230
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1231
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1232
\f3Aloha\&.java          GutenTag\&.java       Hello\&.java          Hi\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1233
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1234
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1235
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1236
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1237
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1238
\f3Example 3 Specify a User Class Path\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1239
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1240
After changing one of the source files in the previous example, recompile it:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1241
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1242
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1243
\f3pwd\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1244
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1245
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1246
\f3/examples\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1247
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1248
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1249
\f3javac greetings/Hi\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1250
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1251
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1252
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1253
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1254
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1255
Because \f3greetings\&.Hi\fR refers to other classes in the \f3greetings\fR package, the compiler needs to find these other classes\&. The previous example works because the default user class path is the directory that contains the package directory\&. If you want to recompile this file without concern for which directory you are in, then add the examples directory to the user class path by setting \f3CLASSPATH\fR\&. This example uses the \f3-classpath\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1256
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1257
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1258
\f3javac \-classpath /examples /examples/greetings/Hi\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1259
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1260
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1261
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1262
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1263
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1264
If you change \f3greetings\&.Hi\fR to use a banner utility, then that utility also needs to be accessible through the user class path\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1265
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1266
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1267
\f3javac \-classpath /examples:/lib/Banners\&.jar \e\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1268
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1269
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1270
\f3            /examples/greetings/Hi\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1271
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1272
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1273
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1274
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1275
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1276
To execute a class in the \f3greetings\fR package, the program needs access to the \f3greetings\fR package, and to the classes that the \f3greetings\fR classes use\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1277
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1278
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1279
\f3java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1280
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1281
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1282
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1283
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1284
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1285
\f3Example 4 Separate Source Files and Class Files\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1286
.PP
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1287
The following example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1288
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1289
.nf     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1290
\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e \fP
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1291
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1292
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1293
\f3\-extdirs "" OldCode\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1294
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1295
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1296
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1297
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1298
.sp     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1299
The \f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language be used to compile \f3OldCode\&.java\fR\&. The option \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&. Note that in most cases, the value of the \f3-target\fR option is the value of the \f3-source\fR option; in this example, you can omit the \f3-target\fR option\&.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1300
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1301
You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1302
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1303
.nf     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1304
\f3javac \-source 1\&.7 OldCode\&.java\fP
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1305
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1306
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1307
\f3warning: [options] bootstrap class path not set in conjunction with \fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1308
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1309
.nf     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1310
\f3\-source 1\&.7\fP
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1311
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1312
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1313
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1314
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1315
.sp     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1316
If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules (in this example, it uses version 1\&.7 of the Java programming language) combined with the new bootstrap classes, which can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1317
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1318
\f3Example 5 Cross Compile\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1319
.PP
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1320
This example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1321
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1322
.nf     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1323
\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e\fP
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1324
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1325
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1326
\f3            \-extdirs "" OldCode\&.java\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1327
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1328
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1329
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1330
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1331
.sp     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1332
The\f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language to be used to compile OldCode\&.java\&. The \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1333
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1334
You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1335
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1336
.nf     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1337
\f3javac \-source 1\&.7 OldCode\&.java\fP
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1338
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1339
.nf     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1340
\f3warning: [options] bootstrap class path not set in conjunction with \-source 1\&.7\fP
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1341
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1342
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1343
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1344
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1345
.sp     
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1346
If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules combined with the new bootstrap classes\&. This combination can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&. In this example, the compiler uses release 1\&.7 of the Java programming language\&.
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1347
.SH SEE\ ALSO    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1348
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1349
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1350
java(1)
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1351
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1352
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1353
jdb(1)
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1354
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1355
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1356
javah(1)
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1357
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1358
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1359
javadoc(1)
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1360
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1361
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1362
jar(1)
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1363
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1364
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
  1365
jdb(1)
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1366
.RE
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1367
.br
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1368
'pl 8.5i
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
  1369
'bp