Java Reference
In-Depth Information
-deprecation
This causes every use or reference to a deprecated class or method to be
displayed on compilation. 2
-g
Put full debugging information in the compiled class files. See also -g:
(the next entry in this list).
-g: keyword_list
This switch gives you fine-grained control over the amount of debug infor-
mation included in compiled class files. The argument after the colon may
be either none , in which case no debug information is included, or a
comma-separated list with any combination of source , to include source
file debugging information, lines , to include line number information,
or vars , to include information about local variable names. The default,
if no -g flag of any kind is specified, is to include source file and line
number information only.
-nowarn
Disables warning messages.
-verbose
Causes the compiler to output information about each class encountered
during compilation. This can be helpful when trying to resolve problems
with missing class definitions.
There are also a number of switches that relate to cross-compiling as well
as UNIX-specific options, but these are not commonly used. Refer to the Sun
Java SDK Tools documentation if you need details on these options.
2. In Java, it is rare for APIs to break support for existing code. Rather than remove old meth-
ods, it is more common to deprecate them. This is done by putting a @deprecated tag in a
Javadoc comment on the class or method. The Java compiler will issue a warning (if the
-deprecated switch is on) whenever a deprecated class or method is used. In general, depre-
cation is a warning that the class or method will be removed in a future version of the code
or library. It is interesting to note that the javac compiler records that a method or class is
deprecated in the binary. Thus the compiler produces different output based on the contents
of a comment. As we have written simple compilers and interpreters, this creeps us out. We
have always wondered why deprecated has not become a Java language keyword.
Search WWH ::




Custom Search