jdk.javadoc/com.sun.tools.javadoc.Main - "javadoc" Command

Q

How to run "javadoc" command from JDK lib\modules JImage file?

✍: FYIcenter

A

"javadoc" command allows you to generate Java documentation in HTML format from Java source code files.

"javadoc" command is supported by the jmods\jdk.jcmd.jmod module file, which is also linked into the lib\modules JImage file in JDK 9, 10, and 11.

You can run the "javadoc" command using the lib\modules JImage file as described below using JDK 11 as an example:

C:\fyicenter>set JDK_HOME=\fyicenter\jdk-11.0.1

C:\fyicenter>%JDK_HOME%\bin\java --module jdk.javadoc/com.sun.tools.javadoc.Main -help

Usage: javadoc [options] [packagenames] [sourcefiles] [@files]
  -overview <file>                 Read overview documentation from HTML file
  -public                          Show only public classes and members
  -protected                       Show protected/public classes and members (default)
  -package                         Show package/protected/public classes and members
  -private                         Show all classes and members
  -help                            Display command line options and exit
  -doclet <class>                  Generate output via alternate doclet
  -docletpath <path>               Specify where to find doclet class files
  --module-source-path <path>      Specify where to find input source files 
                                   for multiple modules
  --upgrade-module-path <path>     Override location of upgradeable modules
  --module-path <path>, -p <path>  Specify where to find application modules
  --add-modules <module>(,<module>)*
                                   Root modules to resolve in addition to the 
                                   initial modules,
                                   or all modules on the module path if <module> 
                                   is ALL-MODULE-PATH.
  --limit-modules <module>(,<module>)*
                                   Limit the universe of observable modules
  --source-path <path>             Specify where to find source files
  -sourcepath <path>               Specify where to find source files
  --class-path <path>              Specify where to find user class files
  -classpath <path>                Specify where to find user class files
  -cp <path>                       Specify where to find user class files
  -exclude <pkglist>               Specify a list of packages to exclude
  -subpackages <subpkglist>        Specify subpackages to recursively load
  -breakiterator                   Compute first sentence with BreakIterator
  -bootclasspath <path>            Override location of platform class files
                                   used for non-modular releases
  --system <jdk>                   Override location of system modules used
                                   for modular releases.
  -source <release>                Provide source compatibility with specified release
  --release <release>              Provide source compatibility with specified release
  -extdirs <dirlist>               Override location of installed extensions
  -verbose                         Output messages about what Javadoc is doing
  -locale <name>                   Locale to be used, e.g. en_US or en_US_WIN
  -encoding <name>                 Source file encoding name
  -quiet                           Do not display status messages
  -J<flag>                         Pass <flag> directly to the runtime system
  -X                               Print a synopsis of nonstandard options and exit

GNU-style options may use = instead whitespace to separate the name of an option
from its value.

 

jdk.javadoc/jdk.javadoc.internal.tool.Main - "javadoc" Command

jdk.jartool/sun.tools.jar.Main - "jar" Command

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2018-11-09, 275👍, 0💬