Java Reference
In-Depth Information
javadoc
is built on top of the same classes as
javac
, and uses some of the source
compiler infrastructure to implement Javadoc features.
The typical way to use
javadoc
is to run it against a whole package, rather than just
a class.
javadoc
has a very large number of switches and options that can control many
aspects of its behavior. Detailed discussion of all the options is outside the scope of
this topic.
jdeps
The
jdeps
tool is a static analysis tool for analyzing the dependencies of packages or
classes. The tool has a number of usages, from identifying developer code that
makes calls into the internal, undocumented JDK APIs (such as the
sun.misc
classes), to helping trace transitive dependencies.
jdeps
can also be used to confirm whether a JAR file can run under a Compact Pro‐
file (see later in the chapter for more details on Compact Profiles).
Basic usage
jdeps com.me.MyClass
Description
jdeps
reports dependency information for the classes it is asked to analyze. The
classes can be specified as any class on the classpath, a file path, a directory, or a JAR
file.
Common switches
-s, -summary
Prints dependency summary only.
-v, -verbose
Prints all class-level dependencies.
-verbose:package
Prints package-level dependencies, excluding dependencies within the same
archive.
-verbose:class
Prints class-level dependencies, excluding dependencies within the same
archive.
-p <pkg name>, -package <pkg name>
Finds dependencies in the specified package. You can specify this option multi‐
ple times for different packages. The
-p
and
-e
options are mutually exclusive.