CPE102 - How to generate Java Documentation HTML files
Many Integrated Development Environments (IDEs) support generating
javadoc HTML files at the "push of a button". It is not much more
difficult to do it from the command-line. Assuming the utility is
installed on the machine you are running on you can simply follow the
steps below. You will need to modify your operating system to
include the location of the javadoc utility for these instructions to
work or, alternatively, you can specifiy the complete path to the
javadoc utility to invoke it.
- Open a terminal on the machine where the Java source files you would like to generate javadocs for exist.
- Change directory (cd) to the directory contain the Java source files.
- Invoke the javadoc tool as follows:
12:01pm vogon $ javadoc YourSourceFileName.java
You will see several lines of output
from the javadoc tool indicating its progress and any warnings or
errors that occur during its execution - be sure to fix all warnings
and errors regererate the HTML files, as necessary.
- Now you can open the generalted HTML files using your favorite browser to see if you like the results.
- Notice that if you want to generate HTML files for all the Java
source files in the current directory you can use the following
shell-supported syntax:
12:01pm vogon $ javadoc *.java