Menu

Read the Javadoc of any jar from the terminal (Maven deps, the JDK, and your AI agent)
📰

Read the Javadoc of any jar from the terminal (Maven deps, the JDK, and your AI agent)

DEV Community: java·Mohammad Mostafa Dastjerdi·11 days ago
#EGXahZAg
#devtojava#devto#dev#tojson#get
Long article (581 words) — no AI summary yet.
Reading 0:00
15s threshold

You're in a terminal, or your AI coding agent is, and you need the Javadoc for one method in a dependency. The usual options: dig through an HTML javadoc tree, open an IDE just to hover, or unzip a -sources.jar and grep for the comment.

jdx is an open-source CLI (and MCP server) that answers IDE questions about JVM jars. One of those questions is "what does the Javadoc say?", and jdx doc prints the answer as plain text, plus the file and line range it came from.

A class comment from a Maven coordinate

$ jdx doc com.google.gson.Gson --coord com.google.code.gson:gson:2.14.0 --fetch com.google.gson.Gson source: gson-2.14.0-sources.jar · com/google/gson/Gson.java:49-134 This is the main class for using Gson. Gson is typically used by first constructing a Gson instance and then invoking #toJson(Object) or Class) methods on it. Gson instances are Thread-safe so you can reuse them freely across multiple threads.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.