Publish your Java library's guides and API reference in one searchable Sphinx
site. sphinx-java-autodoc reads your Java sources and Javadoc comments with the
JDK compiler APIs and renders them as native Sphinx content:
- Generated pages for classes, interfaces, enums, records, annotation types and nested types.
- Signatures, overloads, Javadoc links and inherited method documentation.
- Class excerpts in handwritten guides, and cross-project links through intersphinx.
- Content-based caching: pages refresh when sources change.
Extraction never runs application classes or annotation processors, and never downloads Java dependencies. See the Apache Commons Lang example for the output.
Python 3.12+, Sphinx 8.2.x or 9.1.x, and JDK 25 for extraction. Your library can keep targeting Java 17 or 21. See compatibility and limits.
uv add sphinx-java-autodocIn docs/conf.py:
extensions = ["sphinx_java_autodoc"]
java_sources = ["../src/main/java"]
java_release = "17"
java_generate = "api"
java_visibility = "public"Add api/index to the toctree in docs/index.rst, then build:
uv run sphinx-build -W --keep-going -n docs docs/_build/htmlNext: the first-build walkthrough, writing guides, dependencies and CI and the configuration reference.
See CONTRIBUTING.md. MIT licensed.