Javadoc - Java API documentationλ︎
, h j shows javadoc information for a Java method or class, opening the relevant page on the Oracle website for Java.
Include Java Sourcesλ︎
Include the Java JDK sources when starting the REPL, to be able to navigate to the source definitions of Java methods.
Download the Java JDK sources or install via the operating system package manager, e.g. sudo apt install openjdk-17-source
Use an alias that adds the sources as an :extra-deps
via a :local/root
:src/java17
alias includes the sources for Java 17 on the classpath, making them available for the Cider clj-find-var
lookup.
The alias assumes the sources are located at /usr/lib/jvm/openjdk-17/lib/src.zip
clojure -M:src/java17:repl/rebel
starts a rich terminal UI REPL including the Java sources on the class path.
Navigate Java Source codeλ︎
, g g to run the command clj-find-var
which shows
Clojure LSP hijacks the
, g g
key binding, so useSPC SPC clj-find-var
instead.
Selecting a specific Java package (namespace) will open the Java source code in a buffer
Clojure LSP Java Sourcesλ︎
:source-aliases
key in the Clojure LSP configuration can be used to add Java JDK sources to the Clojure LSP class path.
An alias in the project deps.edn
can be used to include the Java JDK sources
Clojure LSP currently doesn't use the user level
deps.edn
file, so the alias must be in the projectdeps.edn
file.