It Usually Begins with javac
While you can't overlook the fact that the standard Java compiler
javac from Sun includes a lot of error
checking that is mandated by the Java language, you can easily miss the
fact that it has a bunch of extra checking that is yours for the asking.
Simply add the command-line option -Xlint and you will see a number of additional
warnings. You can optionally append a comma-separated list of categories
to this option, as shown in the "javac Xlint options" table—for example,
-Xlint:deprecation,unchecked will run
the standard compiler with extra details on use of deprecated code and
unchecked type conversions.
javac -Xlint options
Option | Meaning |
|---|---|
| Enable all optional
warnings; default if |
| Disable all optional
warnings; default if |
| Enable/disable warnings about deprecated code, code that is no longer a recommended part of the API. |
| Enable/disable detailed warnings about unchecked type conversions. |
| Enable/disable warnings
about case labels that should be preceded by |
| Enable/disable warnings
about missing/unreadable |
| Enable/disable warnings about missing "serial version unique identifiers" (discussed in the section "Enabling Useful Warnings" under Eclipse). ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access