diff -r bad7bbf42755 -r 345bc8d65b19 jdk/src/linux/doc/man/javac.1 --- a/jdk/src/linux/doc/man/javac.1 Thu Apr 30 15:04:39 2009 -0700 +++ b/jdk/src/linux/doc/man/javac.1 Mon May 04 18:28:26 2009 -0700 @@ -1,5 +1,3 @@ -.'" t -." ." Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. ." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ." @@ -20,13 +18,12 @@ ." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ." CA 95054 USA or visit www.sun.com if you need additional information or ." have any questions. -." -." ` -.TH javac 1 "07 Aug 2006" -." Generated by html2man +." +.TH javac 1 "04 May 2009" +." Generated from HTML by html2man (author: Eric Armstrong) .LP -.SH NAME +.SH "Name" javac \- Java programming language compiler .LP .SH "SYNOPSIS" @@ -36,7 +33,9 @@ .nf \f3 .fl -\fP\f3javac\fP [ options ] [ sourcefiles ] [ @argfiles ] + \fP\f3javac\fP [ options ] [ sourcefiles ] [ classes ] [ @argfiles ] +.fl + .fl .fi @@ -55,6 +54,9 @@ sourcefiles One or more source files to be compiled (such as MyClass.java). .TP 3 +classes +One or more classes to be processed for annotations (such as MyPackage.MyClass). +.TP 3 @argfiles One or more files that lists options and source files. The \f2\-J\fP options are not allowed in these files. .RE @@ -66,10 +68,10 @@ .LP .LP -The \f3javac\fP tool reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files. +The \f3javac\fP tool reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files. It can also process annotations in Java source files and classes. .LP .LP -There are two ways to pass source code filenames to \f3javac\fP: +There are two ways to pass source code file names to \f3javac\fP: .LP .RS 3 .TP 2 @@ -93,46 +95,6 @@ .LP By default, the compiler puts each class file in the same directory as its source file. You can specify a separate destination directory with \f3\-d\fP (see Options, below). .LP -.SH "SEARCHING FOR TYPES" -.LP - -.LP -.LP -When compiling a source file, the compiler often needs information about a type whose definition did not appear in the source files given 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 which provide information through inheritance. -.LP -.LP -For example, when you subclass \f3java.applet.Applet\fP, you are also using \f3Applet's\fP ancestor classes: \f3java.awt.Panel\fP, \f3java.awt.Container\fP, \f3java.awt.Component\fP, and \f3java.lang.Object\fP. -.LP -.LP -When the compiler needs type information, it looks for a source file or class file which 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\fP environment variable or by using the \f3\-classpath\fP command line option. (For details, see Setting the Class Path). -.LP -.LP -If you set the \-sourcepath option, the compiler searches the indicated path for source files; otherwise the compiler searches the user class path for both class files and source files. -.LP -.LP -You can specify different bootstrap or extension classes with the \f3\-bootclasspath\fP and \f3\-extdirs\fP options; see Cross\-Compilation Options below. -.LP -.LP -A successful type search may produce a class file, a source file, or both. Here is how \f3javac\fP handles each situation: -.LP -.RS 3 -.TP 2 -o -\f2Search produces a class file but no source file:\fP \f3javac\fP uses the class file. -.TP 2 -o -\f2Search produces a source file but no class file:\fP \f3javac\fP compiles the source file and uses the resulting class file. -.TP 2 -o -\f2Search produces both a source file and a class file:\fP \f3javac\fP determines whether the class file is out of date. If the class file is out of date, \f3javac\fP recompiles the source file and uses the updated class file. Otherwise, \f3javac\fP just uses the class file. -.LP -\f3javac\fP considers a class file out of date only if it is older than the source file. -.RE - -.LP -.LP -\f3Note:\fP \ \f3javac\fP can silently compile source files not mentioned on the command line. Use the \f3\-verbose\fP option to trace automatic compilation. -.LP .SH "OPTIONS" .LP @@ -148,15 +110,24 @@ .LP .RS 3 .TP 3 -\-classpath classpath -Set the user class path, overriding the user class path in the \f3CLASSPATH\fP environment variable. If neither \f3CLASSPATH\fP or \f3\-classpath\fP is specified, the user class path consists of the current directory. See Setting the Class Path for more details. +\-Akey[=value] +Options to pass to annotation processors. These are not interpreted by javac directly, but are made available for use by individual processors. \f2key\fP should be one or more identifiers separated by ".". +.TP 3 +\-cp path or \-classpath path +Specify where to find user class files, and (optionally) annotation processors and source files. This classpath overrides the user class path in the \f3CLASSPATH\fP environment variable. If neither \f3CLASSPATH\fP, \f3\-cp\fP nor \f3\-classpath\fP is specified, the user class path consists of the current directory. See +.na +\f2Setting the Class Path\fP @ +.fi +http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath for more details. .LP -If the \f3\-sourcepath\fP option is not specified, the user class path is searched for both source files and class files. +If the \f3\-sourcepath\fP option is not specified, the user class path is also searched for source files. .LP -As a special convenience, a class path element containing a basename of \f2*\fP is considered equivalent to specifying a list of all the files in the directory with the extension \f2.jar\fP or \f2.JAR\fP (a java program cannot tell the difference between the two invocations). +If the \f3\-processorpath\fP option is not specified, the classpath is also searched for annotation processors. +.LP +As a special convenience, a class path element containing a basename of \f2*\fP is considered equivalent to specifying a list of all the files in the directory with the extension \f2.jar\fP or \f2.JAR\fP. .br .br -For example, if directory \f2foo\fP contains \f2a.jar\fP and \f2b.JAR\fP, then the class path element \f2foo/*\fP is expanded to a \f2A.jar:b.JAR\fP, except that the order of jar files is unspecified. All jar files in the specified directory, even hidden ones, are included in the list. A classpath entry consisting simply of \f2*\fP expands to a list of all the jar files in the current directory. The \f2CLASSPATH\fP environment variable, where defined, will be similarly expanded. Any classpath wildcard expansion occurs before the Java virtual machine is started \-\- no Java program will ever see unexpanded wildcards except by querying the environment. For example; by invoking \f2System.getenv("CLASSPATH")\fP. +For example, if directory \f2foo\fP contains \f2a.jar\fP and \f2b.JAR\fP, then the class path element \f2foo/*\fP is expanded to \f2A.jar:b.JAR\fP, except that the order of jar files is unspecified. All jar files in the specified directory, even hidden ones, are included in the list. A classpath entry consisting simply of \f2*\fP expands to a list of all the jar files in the current directory. The \f2CLASSPATH\fP environment variable, where defined, will be similarly expanded. \f3Note:\fP \ Depending of the configuration of your command line environment, you may have to quote the wild card character, for example, \f2javac \-cp "*.jar" MyClass.java\fP. .TP 3 \-Djava.ext.dirs=directories Override the location of installed extensions. @@ -165,17 +136,17 @@ Override the location of endorsed standards path. .TP 3 \-d directory -Set the destination directory for class files. The destination directory must already exist; javac will not create the destination directory. If a class is part of a package, \f3javac\fP puts the class file in a subdirectory reflecting the package name, creating directories as needed. For example, if you specify \f3\-d /home/myclasses\fP and the class is called \f2com.mypackage.MyClass\fP, then the class file is called \f2/home/myclasses/com/mypackage/MyClass.class\fP. +Set the destination directory for class files. The directory must already exist; \f3javac\fP will not create it. If a class is part of a package, \f3javac\fP puts the class file in a subdirectory reflecting the package name, creating directories as needed. For example, if you specify \f3\-d /home/myclasses\fP and the class is called \f2com.mypackage.MyClass\fP, then the class file is called \f2/home/myclasses/com/mypackage/MyClass.class\fP. .LP -If \f3\-d\fP is not specified, \f3javac\fP puts the class file in the same directory as the source file. +If \f3\-d\fP is not specified, \f3javac\fP puts each class files in the same directory as the source file from which it was generated. .LP \f3Note:\fP \ The directory specified by \f3\-d\fP is not automatically added to your user class path. .TP 3 \-deprecation -Show a description of each use or override of a deprecated member or class. Without \f3\-deprecation\fP, \f3javac\fP shows the names of source files that use or override deprecated members or classes. \f3\-deprecation\fP is shorthand for \f3\-Xlint:deprecation\fP. +Show a description of each use or override of a deprecated member or class. Without \f3\-deprecation\fP, \f3javac\fP shows a summary of the source files that use or override deprecated members or classes. \f3\-deprecation\fP is shorthand for \f3\-Xlint:deprecation\fP. .TP 3 \-encoding encoding -Set the source file encoding name, such as \f2EUC\-JP and UTF\-8.\fP. If \f3\-encoding\fP is not specified, the platform default converter is used. +Set the source file encoding name, such as \f2EUC\-JP and UTF\-8\fP. If \f3\-encoding\fP is not specified, the platform default converter is used. .TP 3 \-g Generate all debugging information, including local variables. By default, only line number and source file information is generated. @@ -200,9 +171,23 @@ \-help Print a synopsis of standard options. .TP 3 +\-implicit:{class,none} +Controls the generation of class files for implicitly loaded source files. To automatically generate class files, use \f3\-implicit:class\fP. To suppress class file generation, use \f3\-implicit:none\fP. If this option is not specified, the default is to automatically generate class files. In this case, the compiler will issue a warning if any such class files are generated when also doing annotation processing. The warning will not be issued if this option is set explicitly. See Searching For Types. +.TP 3 \-nowarn Disable warning messages. This has the same meaning as \f3\-Xlint:none\fP. -.LP +.TP 3 +\-proc: {none,only} +Controls whether annotation processing and/or compilation is done. \f3\-proc:none\fP means that compilation takes place without annotation processing. \f3\-proc:only\fP means that only annotation processing is done, without any subsequent compilation. +.TP 3 +\-processor class1[,class2,class3...] +Names of the annotation processors to run. This bypasses the default discovery process. +.TP 3 +\-processorpath path +Specify where to find annotation processors; if this option is not used, the classpath will be searched for processors. +.TP 3 +\-s dir +Specify the directory where to place generated source files. The directory must already exist; \f3javac\fP will not create it. If a class is part of a package, the compiler puts the source file in a subdirectory reflecting the package name, creating directories as needed. For example, if you specify \f3\-s /home/mysrc\fP and the class is called \f2com.mypackage.MyClass\fP, then the source file will be placed in \f2/home/mysrc/com/mypackage/MyClass.java\fP. .TP 3 \-source release Specifies the version of source code accepted. The following values for \f2release\fP are allowed: @@ -215,20 +200,34 @@ The compiler accepts code containing assertions, which were introduced in JDK 1.4. .TP 3 1.5 -The compiler accepts code containing generics and other language features introduced in JDK 5. This is the default. +The compiler accepts code containing generics and other language features introduced in JDK 5. .TP 3 5 -Synonym for 1.5 +Synonym for 1.5. +.TP 3 +1.6 +This is the default value. No language changes were introduced in Java SE 6. However, encoding errors in source files are now reported as errors, instead of warnings, as previously. +.TP 3 +6 +Synonym for 1.6. +.TP 3 +1.7 +The compiler accepts code with features introduced in JDK 7. +.TP 3 +7 +Synonym for 1.7. .RE -\f3Note:\fP No language changes were introduced in JDK 6, so the values \f31.6\fP and \f36\fP are not valid. .TP 3 \-sourcepath sourcepath Specify the source code path to search for class or interface definitions. As with the user class path, source path entries are separated by colons (\f3:\fP) and can be directories, JAR archives, or ZIP archives. If packages are used, the local path name within the directory or archive must reflect the package name. .LP -\f3Note:\fP \ Classes found through the classpath are subject to automatic recompilation if their sources are found. +\f3Note:\fP \ Classes found through the classpath may be subject to automatic recompilation if their sources are also found. See Searching For Types. .TP 3 \-verbose -Verbose output. This includes information about each class loaded and each source file compiled. +Verbose output. This includes information about each class loaded and each source file compiled. +.TP 3 +\-version +Print version information. .TP 3 \-X Display information about non\-standard options and exit. @@ -248,7 +247,7 @@ .RS 3 .TP 3 \-target version -Generate class files that target a specified version of the VM. Class files will run on the specified target and on later versions, but not on earlier versions of the VM. Valid targets are \f31.1\fP \f31.2\fP \f31.3\fP \f31.4\fP \f31.5\fP (also \f35\fP) and \f31.6\fP (also \f36\fP). +Generate class files that target a specified version of the VM. Class files will run on the specified target and on later versions, but not on earlier versions of the VM. Valid targets are \f31.1\fP \f31.2\fP \f31.3\fP \f31.4\fP \f31.5\fP (also \f35\fP) \f31.6\fP (also \f36\fP) and \f31.7\fP (also \f37\fP). .LP The default for \f3\-target\fP depends on the value of \f3\-source\fP: .RS 3 @@ -257,7 +256,10 @@ If \-source is \f3not specified\fP, the value of \-target is \f31.6\fP .TP 2 o -If \-source is \f31.3\fP, the value of \-target is \f31.1\fP +If \-source is \f31.2\fP, the value of \-target is \f31.4\fP +.TP 2 +o +If \-source is \f31.3\fP, the value of \-target is \f31.4\fP .TP 2 o For \f3all other values\fP of \-source, the value of \-target is the value of \f3\-source\fP. @@ -295,8 +297,8 @@ \-Xlint:none Disable all warnings not mandated by the Java Language Specification. .TP 3 -\-Xlint:\-xxx -Disable warning \f3xxx\fP, where \f3xxx\fP is one of the warning names supported for \f3\-Xlint:xxx\fP, below +\-Xlint:\-name +Disable warning \f2name\fP, where \f2name\fP is one of the warning names supported for \f3\-Xlint:\fP\f2name\fP, below. .TP 3 \-Xlint:unchecked Give more detail for unchecked conversion warnings that are mandated by the Java Language Specification. @@ -311,7 +313,7 @@ Warn about \f2finally\fP clauses that cannot complete normally. .TP 3 \-Xlint:fallthrough -Check \f2switch\fP blocks for fall\-through cases and provide a warning message for any that are found. Fall\-through cases are cases in a \f2switch\fP block, other than the last case in the block, whose code does not include a \f2break\fP statement, allowing code execution to "fall through" from that case to the next case. For example, the code following the \f2case 1\fP label in this \f2switch\fP block does not contain a \f2break\fP statement: +Check \f2switch\fP blocks for fall\-through cases and provide a warning message for any that are found. Fall\-through cases are cases in a \f2switch\fP block, other than the last case in the block, whose code does not include a \f2break\fP statement, allowing code execution to "fall through" from that case to the next case. For example, the code following the \f2case 1\fP label in this \f2switch\fP block does not end with a \f2break\fP statement: .RS 3 .LP @@ -332,12 +334,14 @@ .fl } .fl + +.fl \fP .fi .RE If the \f2\-Xlint:fallthrough\fP flag were used when compiling this code, the compiler would emit a warning about "possible fall\-through into case," along with the line number of the case in question. .TP 3 -\-Xmaxerrors number +\-Xmaxerrs number Set the maximum number of errors to print. .TP 3 \-Xmaxwarns number @@ -345,6 +349,18 @@ .TP 3 \-Xstdout filename Send compiler messages to the named file. By default, compiler messages go to \f2System.err\fP. +.TP 3 +\-Xprefer:{newer,source} +Specify which file to read when both a source file and class file are found for a type. (See Searching For Types). If \f2\-Xprefer:newer\fP is used, it reads the newer of the source or class file for a type (default). If the \f2\-Xprefer:source\fP option is used, it reads source file. Use \f2\-Xprefer:source\fP when you want to be sure that any annotation processors can access annotations declared with a retention policy of \f2SOURCE\fP. +.TP 3 +\-Xprint +Print out textual representation of specified types for debugging purposes; perform neither annotation processing nor compilation. The format of the output may change. +.TP 3 +\-XprintProcessorInfo +Print information about which annotations a processor is asked to process. +.TP 3 +\-XprintRounds +Print information about initial and subsequent annotation processing rounds. .RE .LP @@ -390,7 +406,9 @@ .nf \f3 .fl - C:> \fP\f3javac @argfile\fP + % \fP\f3javac @argfile\fP +.fl + .fl .fi @@ -414,7 +432,9 @@ .fl \-g .fl - \-sourcepath \\java\\pubs\\ws\\1.3\\src\\share\\classes + \-sourcepath /java/pubs/ws/1.3/src/share/classes +.fl + .fl \fP .fi @@ -432,18 +452,22 @@ .fl MyClass3.java .fl + +.fl \fP .fi .LP .LP -You would then run javac with: +You would then run \f3javac\fP with: .LP .nf \f3 .fl % \fP\f3javac @options @classes\fP .fl + +.fl .fi .LP @@ -458,11 +482,119 @@ .fl % \fP\f3javac @path1/options @path2/classes\fP .fl + +.fl .fi .LP +.SH "ANNOTATION PROCESSING" +.LP + +.LP +.LP +\f3javac\fP provides direct support for annotation processing, superseding the need for the separate annotation processing tool, \f3apt\fP. +.LP +.LP +The API for annotation processors is defined in the \f2javax.annotation.processing\fP and \f2javax.lang.model\fP packages and subpackages. +.LP +.SS +Overview of annotation processing +.LP +.LP +Unless annotation processing is disabled with the \f3\-proc:none\fP option, the compiler searches for any annotation processors that are available. The search path can be specified with the \f3\-processorpath\fP option; if it is not given, the user class path is used. Processors are located by means of service provider\-configuration files named +.br +\f2\ META\-INF/services/javax.annotation.processing.Processor\fP +.br +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\fP option. +.LP +.LP +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 will be invoked. A processor may "claim" the annotations it processes, in which case no further attempt is made to find any processors for those annotations. Once all annotations have been claimed, the compiler does not look for additional processors. +.LP +.LP +If any processors generate any new source files, another round of annotation processing will occur: any newly generated source files will be scanned, and the annotations processed as before. Any processors invoked on previous rounds will also be invoked on all subsequent rounds. This continues until no new source files are generated. +.LP +.LP +After a round occurs where no new source files are generated, the annotation processors will be invoked one last time, to give them a chance to complete any work they may need to do. Finally, unless the \f3\-proc:only\fP option is used, the compiler will compile the original and all the generated source files. +.LP +.SS +Implicitly loaded source files +.LP +.LP +To compile a set of source files, the compiler may need to implicitly load additional source files. (See Searching For Types). Such files are currently not subject to annotation processing. By default, the compiler will give a warning if annotation processing has occurred and any implicitly loaded source files are compiled. See the \-implicit option for ways to suppress the warning. +.LP +.SH "SEARCHING FOR TYPES" +.LP + +.LP +.LP +When compiling a source file, the compiler often needs information about a type whose definition did not appear in the source files given 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 which provide information through inheritance. +.LP +.LP +For example, when you subclass \f3java.applet.Applet\fP, you are also using \f3Applet's\fP ancestor classes: \f3java.awt.Panel\fP, \f3java.awt.Container\fP, \f3java.awt.Component\fP, and \f3java.lang.Object\fP. +.LP +.LP +When the compiler needs type information, it looks for a source file or class file which 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\fP environment variable or by using the \f3\-classpath\fP command line option. (For details, see +.na +\f2Setting the Class Path\fP @ +.fi +http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath). +.LP +.LP +If you set the \-sourcepath option, the compiler searches the indicated path for source files; otherwise the compiler searches the user class path for both class files and source files. +.LP +.LP +You can specify different bootstrap or extension classes with the \f3\-bootclasspath\fP and \f3\-extdirs\fP options; see Cross\-Compilation Options below. +.LP +.LP +A successful type search may produce a class file, a source file, or both. If both are found, you can use the \-Xprefer option to instruct the compiler which to use. If \f3newer\fP is given, the compiler will use the newer of the two files. If \f3source\fP is given, it will use the source file. The default is \f3newer\fP. +.LP +.LP +If a type search finds a source file for a required type, either by itself, or as a result of the setting for \f3\-Xprefer\fP, the compiler will read the source file to get the information it needs. In addition, it will by default compile the source file as well. You can use the \-implicit option to specify the behavior. If \f3none\fP is given, no class files will be generated for the source file. If \f3class\fP is given, class files will be generated for the source file. +.LP +.LP +The compiler may not discover the need for some type information until after annotation processing is complete. If the type information is found in a source file and no \f3\-implicit\fP option is given, the compiler will give 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\fP option to specify whether or not class files should be generated for such source files. +.LP .SH "PROGRAMMATIC INTERFACE" .LP + +.LP +.LP +\f3javac\fP supports the new Java Compiler API defined by the classes and interfaces in the \f2javax.tools\fP package. +.LP +.SS +Example +.LP +.LP +To perform a compilation using arguments as you would give on the command line, you can use the following: +.LP +.nf +\f3 +.fl +JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); +.fl +int rc = javac.run(null, null, null, args); +.fl + +.fl +\fP +.fi + +.LP +.LP +This will write any diagnostics to the standard output stream, and return the exit code that \f3javac\fP would give when invoked from the command line. +.LP +.LP +You can use other methods on the \f2javax.tools.JavaCompiler\fP interface to handle diagnostics, control where files are read from and written to, and so on. +.LP +.SS +Old Interface +.LP +.RS 3 + +.LP +.LP +\f3Note:\fP \ This API is retained for backwards compatibility only; all new code should use the Java Compiler API, described above. +.LP .LP The \f2com.sun.tools.javac.Main\fP class provides two static methods to invoke the compiler from a program: .LP @@ -473,6 +605,8 @@ .fl public static int compile(String[] args, PrintWriter out); .fl + +.fl \fP .fi @@ -484,11 +618,12 @@ The \f2out\fP parameter indicates where the compiler's diagnostic output is directed. .LP .LP -The return value is equivalent to the exit value from javac. +The return value is equivalent to the exit value from \f3javac\fP. .LP .LP Note that all \f3other\fP classes and methods found in a package whose name starts with \f2com.sun.tools.javac\fP (informally known as sub\-packages of \f2com.sun.tools.javac\fP) are strictly internal and subject to change at any time. .LP +.RE .SH "EXAMPLES" .LP .SS @@ -548,6 +683,8 @@ .fl Hello Everyone .fl + +.fl .fi .RE @@ -586,6 +723,8 @@ .fl .fl + +.fl .fi .RE @@ -612,6 +751,8 @@ .fl % \f3javac greetings/Hi.java\fP .fl + +.fl .fi .RE @@ -627,6 +768,8 @@ .fl % \fP\f3javac \-classpath /examples /examples/greetings/Hi.java\fP .fl + +.fl .fi .RE @@ -640,9 +783,11 @@ .nf \f3 .fl -% \fP\f3javac \-classpath /examples:/lib/Banners.jar \\ +% \fP\f3javac \-classpath /examples:/lib/Banners.jar \\ .fl - /examples/greetings/Hi.java\fP + /examples/greetings/Hi.java\fP +.fl + .fl .fi .RE @@ -659,6 +804,8 @@ .fl % \fP\f3java \-classpath /examples:/lib/Banners.jar greetings.Hi\fP .fl + +.fl .fi .RE @@ -697,9 +844,9 @@ .fl % \f3ls classes\fP .fl -% \f3javac \-sourcepath src \-classpath classes:lib/Banners.jar \\ +% \f3javac \-sourcepath src \-classpath classes:lib/Banners.jar \\ .fl - src/farewells/GoodBye.java \-d classes\fP + src/farewells/GoodBye.java \-d classes\fP .fl % \f3ls classes\fP .fl @@ -711,6 +858,8 @@ .fl .fl + +.fl .fi .RE @@ -726,7 +875,7 @@ .LP .LP -Here we use \f3javac\fP to compile code that will run on a 1.4 VM. +Here we use \f3javac\fP to compile code that will run on a 1.7 VM. .LP .RS 3 @@ -734,19 +883,21 @@ .nf \f3 .fl -% \fP\f3javac \-target 1.4 \-bootclasspath jdk1.4.2/lib/classes.zip \\ +% \fP\f3javac \-target 1.7 \-bootclasspath jdk1.7.0/lib/rt.jar \\ .fl - \-extdirs "" OldCode.java\fP + \-extdirs "" OldCode.java\fP +.fl + .fl .fi .RE .LP .LP -The \f3\-target 1.4\fP option ensures that the generated class files will be compatible with 1.4 VMs. By default, \f3javac\fP compiles for JDK 6. +The \f3\-target 1.7\fP option ensures that the generated class files will be compatible with 1.7 VMs. By default, \f3javac\fP compiles for JDK 6. .LP .LP -The Java Platform JDK's \f3javac\fP would also by default compile against its own bootstrap classes, so we need to tell \f3javac\fP to compile against JDK 1.4 bootstrap classes instead. We do this with \f3\-bootclasspath\fP and \f3\-extdirs\fP. Failing to do this might allow compilation against a Java Platform API that would not be present on a 1.4 VM and would fail at runtime. +The Java Platform JDK's \f3javac\fP would also by default compile against its own bootstrap classes, so we need to tell \f3javac\fP to compile against JDK 1.7 bootstrap classes instead. We do this with \f3\-bootclasspath\fP and \f3\-extdirs\fP. Failing to do this might allow compilation against a Java Platform API that would not be present on a 1.7 VM and would fail at runtime. .LP .RE .SH "SEE ALSO" @@ -756,22 +907,28 @@ .RS 3 .TP 2 o -java \- the Java Application Launcher +.na +\f2The javac Guide\fP @ +.fi +http://java.sun.com/javase/6/docs/technotes/guides/javac/index.html .TP 2 o -jdb \- Java Application Debugger +java(1) \- the Java Application Launcher .TP 2 o -javah \- C Header and Stub File Generator +jdb(1) \- Java Application Debugger +.TP 2 +o +javah(1) \- C Header and Stub File Generator .TP 2 o -javap \- Class File Disassembler +javap(1) \- Class File Disassembler .TP 2 o -javadoc \- API Documentation Generator +javadoc(1) \- API Documentation Generator .TP 2 o -jar \- JAR Archive Tool +jar(1) \- JAR Archive Tool .TP 2 o .na