LinuxCommandLibrary

javadoc

generates API documentation from Java source code

TLDR

Generate documentation

$ javadoc [*.java]
copy
Output to directory
$ javadoc -d [docs/] [*.java]
copy
Include private members
$ javadoc -private [*.java]
copy
Generate with classpath
$ javadoc -cp [lib/*] [src/*.java]
copy
Document package
$ javadoc -d [docs/] -sourcepath [src/] [com.example]
copy
Link to external docs
$ javadoc -link [https://docs.oracle.com/javase/17/docs/api/] [*.java]
copy

SYNOPSIS

javadoc [options] sources...

DESCRIPTION

javadoc generates API documentation from Java source code. It parses Javadoc comments and produces HTML pages.
The tool creates navigable documentation with class hierarchies, method details, and cross-references. It's the standard Java documentation generator.

PARAMETERS

-d DIR

Output directory.
-sourcepath PATH
Source file path.
-cp PATH
Classpath for dependencies.
-private
Include all members.
-public
Include only public.
-link URL
Link to external documentation.
-author
Include @author tags.
--help
Display help information.

CAVEATS

Requires source code. Comment format matters. Large projects may be slow.

HISTORY

javadoc has been part of the JDK since Java 1.0, created by Sun Microsystems for generating API documentation.

SEE ALSO

javac(1), java(1), doxygen(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard