Using the Javadoc Tool

Now that you are ready to generate your documentation, whip out a console and get ready to rumble.

Here's the usage for the Javadoc tool:

javadoc [options] [packagenames] [sourcefiles] [@files]

To see a full list of usage options, simply get a console and type javadoc –help and hit Enter. Here's a basic way to generate your docs:

  1. At the console, navigate to the directory that contains the package you want to document.

  2. Type javadoc -d DocOutputDirectory PackageName

To document the net.javagarage package and put it into the /eben/home/MyJavaDocs directory, I type this:

>javadoc -d /eben/home/MyJavaDocs net.javagarage

The utility runs outputting what it is doing along the way. It creates several directories and many files, ...

Get Java Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.