liveBook · Manning

Javadoc

As explained in Clojure: The Essential Reference

The javadoc command is a Java Development Kit command-line tool that generates HTML API documentation from documented Java source code.

Javadoc is Java’s documentation markup and command-line tool for generating HTML API documentation from documented source code. The output uses folders and subfolders plus an index.html, making APIs available for browser-based offline or online lookup. section 22.10

Clojure developers can use clojure.java.javadoc to open documentation directly from the REPL. The javadoc function resolves local or remote package locations before optionally trying a search-based fallback. section 22.10 section 23.15

Practical configuration includes:

  • Register remote documentation with add-remote-javadoc, including URLs selected from the current Java version. section 22.10
  • Register local documentation with add-local-javadocs or bind *local-javadocs* for a JVM session. section 23.15
  • Customize *remote-javadocs*, *feeling-lucky*, and *feeling-lucky-url* when defaults do not locate the desired API. section 23.15

Open documentation from the REPL

Require the namespace and pass a Java object or class-like value: (require '[clojure.java.javadoc :as browse]) followed by (browse/javadoc "this is a string object"). The function opens the String documentation and returns true; undocumented values can fail unless a fallback is enabled.

How Clojure: The Essential Reference covers it

How deep it goes
Explains HTML output, lookup mappings, dynamic configuration, and fallback limitations, but does not detail Javadoc markup syntax.
Examples
Uses String lookup, undocumented values, Java-version URL construction, remote mappings, and local JDK documentation.
What it assumes
Assumes familiarity with Java APIs, Clojure namespaces, REPL evaluation, and basic dynamic variable binding.
What you can do after
Operate/configure Javadoc lookup from Clojure and open matching local or remote API documentation.
How it connects
Connects Java, Clojure, the REPL, HTML documentation, remote repositories, local files, and dynamic variables.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Clojure: The Essential Reference. The section links point to the parts of the book it draws on.