Appendix G. Tool Summary
In this summary, we use a monospaced font for actual commands such as javac
. An italic font denotes descriptions of tool command components such as options. Items enclosed in brackets [...] are optional. Items separated by vertical bars | are alternatives. Do not include the brackets or vertical bars when typing the commands.
The Java Compiler
javac [options
]sourceFile
1|@fileList
1sourceFile
2|@fileList
2 ...
A file list is a text file that contains one file name per line. For example,
File Greeting.list
1
Greeting.java2
GreetingTest.java
Then you can compile all files with the command
javac @Greeting.list
The Java compiler options are summarized in Table 1.
Table G.1. Common Compiler Options
Option | Description |
---|---|
| The compiler is to look for classes on this path, overriding the Each location is a directory, JAR file, or ZIP file. Locations are separated by a platform-dependent separator ( |
| The compiler is to look for source files on this path. If not specified, source files are searched in the class path. |
| The compiler places files into the specified directory. |
| Generate debugging information. |
| Include information about all classes that are being compiled (useful for troubleshooting). |
| Give detailed information about the usage of deprecated messages. |
| Carry out additional ... |
Get Big Java, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.