Java Reference
In-Depth Information
The following command will generate documentation for only
Dummy.java
source file:
C:\projects>javadoc -d docs src/com/jdojo/utility/Dummay.java
The following command is entered on one line even though it is shown on two lines. It will generate
documentation for all source code under the
com.jdojo
package and its subpackages. It will include the overview
comments from
C:\projects\src\overview.html
file. It will place the output in the
C:\projects\docs
directory.
C:\projects>javadoc -d docs -overview src\overview.html -sourcepath src -subpackages com.jdojo
By default, the
javadoc
tool does not generate documentation for the
@author
and
@version
tags. You need
to use the
-author
and
-version
options to include the text for
@author
and
@version
tags in the generated
documentation, respectively.
The following command will generate documentation for
com.jdojo.utility
package. The documentation will
include text for
@author
and
@version
tags.
C:\projects>javadoc -d docs -author -version -sourcepath src com.jdojo.utility
You can use one or more argument files to store all the arguments to the
javadoc
tool. Note that
-J
options
and wildcards (
*
) are not supported in argument files. You must use the command line to enter these two types of
arguments. Suppose the following is the contents of a file named
args.txt
, which is placed in
C:\projects
directory:
-d docs
-author
-sourcepath src
-subpackages com.jdojo
You can run the
javadoc
tool that will use arguments from the
args.txt
file, as shown below. All relative paths in
the argument file are resolved with respect to the current directory.
C:\projects>javadoc @args.txt
You can split the arguments for the
javadoc
in multiple files. You can pass multiple argument files to the
javadoc
tool by separating them by a space, as shown below. Options can be distributed among multiple argument files in any
order. You can use a relative path (e.g.,
args.txt
) or its absolute path (e.g.,
C:\projects\args.txt
) of the argument
file to the
javadoc
tool.
C:\projects>javadoc @args1.txt @args2.txt @args3.txt
Generated Documentation Files
The
javadoc
tool generates many HTML files. All generated files can be classified into three categories:
Files for classes, interfaces, enums, annotations, packages, and overviews
•
•
Files to cross-reference some pieces of information from one HTML page to another, such as
an index page, a class hierarchy page for each package, a Use page for each package, etc.
•
Support files