Skip to content

Browsing

Danny Thomas edited this page Sep 18, 2026 · 1 revision

From a ja workspace, open API documentation for the modules selected by the current directory:

ja doc --browse

Open a qualified type directly:

ja doc --browse java.lang.String
ja doc --browse com.example.application.Main

ja resolves the workspace's modular compilation context and supplies it to jdocserver.

Use the standalone command to browse the running JDK:

jdocserver --browse

Open a JDK type directly with the standalone command:

jdocserver --browse=java.lang.String

Browsing the JDK requires its source archive at lib/src.zip.

Without --browse, the server prints its URL and remains in the foreground until interrupted:

$ jdocserver
...
Generating standard Javadoc overview in the background...
Type documentation is generated on demand.
Serving Java API documentation on 127.0.0.1 port 8000
URL http://127.0.0.1:8000/

Browse a project

Supply the same modular Java options used to compile the project:

jdocserver \
  --module-path build/modules:lib/example.jar \
  --module-source-path src \
  --module com.example.application \
  --source-path lib/example-sources.jar

Argument files are also accepted. For example, main.args can contain one argument on each non-empty line:

--module-path
build/modules:lib/example.jar
--module-source-path
src
--module
com.example.application
--source-path
lib/example-sources.jar

Start the server with that context and open its overview:

jdocserver --browse @main.args

Module-path, module-source-path, source-path, and system entries retain their standard JDK ordering and lookup semantics. Other supported inputs include --add-modules, --limit-modules, --add-reads, --add-exports, --patch-module, --release, --source, and --enable-preview.

Select another JDK with --system:

jdocserver --system /path/to/jdk @main.args

The selected JDK must provide lib/src.zip so its module and package documentation can be included.

Clone this wiki locally