Document a package using Javadoc Tag(s): Environment
Suppose I have a package called com.rgagnon with one HelloWorld class.
com rgagnon HelloWorld.java
This must be a complete HTML file (with HEAD and BODY). the first line of the body will be used a the package description by javadoc.
<html><head></head><body> this is <i>com.rgagnon</i> package description, see <a href="http://www.rgagnon.com" target="_top">web site</a> </body></html>
\progra~1\Java\jdk1.5.0\bin\javadoc -d javadoc0 -linksource com.rgagnon
-linksource to create HTML version of the source file.
See the result.
Since JDK 1.5, to create a package comment file, you have a choice of two files to place your comments:
- package-info.java - Can contain a package declaration, package annotations, package comments and Javadoc tags. This file is new in JDK 5.0, and is preferred over package.html.
- package.html - Can contain only package comments and Javadoc tags, no package annotations.