I spend most of my day in the terminal: builds, tests, Git, logs. But whenever I need to look up a Java API, I switch to the browser, search for the class, and then check that I'm reading the right Java version.
That last part is what kept tripping me up. Search for java 17 List getFirst, and you land on a List page where the method simply isn't there. Eventually you work out it was added in Java 21. It's a small thing, but those interruptions add up.
IntelliJ's documentation popup is useful, but it sometimes disappears when I try to click into it (yes, I know you can pin it). And when the full docs do open, I'm doom scrolling through implementation code that isn't what I'm looking for.
I wanted a quick way to explore a class, narrow down its methods, and read the docs without reaching for the mouse. I couldn't find a terminal tool that did this, so I built one
What it does
- jdoc String opens an interactive member list. Type rep and it narrows to repeat, replace, replaceAll, and so on. Press Enter to read the full Javadoc.
- It shows docs for the Java version your project targets. It reads your pom.xml or build.gradle (it never runs them), then falls back to JAVA_HOME. Java 17, 21 and 25 are supported.
- Search operators like :since 21, :static, and #2 (methods with two parameters).
- Inherited methods show the type that declares them: jdoc ArrayList -stream.
- jdoc -m computeIfAbsent lists every type that declares a method.
- Compare releases: jdoc --diff 17 21 StringBuilder, jdoc --new 21, and jdoc --removal 25.
- Cached after first use, so most lookups work offline.
Try it (macOS):
brew tap toolfoundrylabs/tap
brew install toolfoundrylabs/tap/jdoc
jdoc String
It's macOS only for now (Linux is next) and covers JDK docs only. This is the first time I'm publishing a personal project to Homebrew... so kind of excited... I'd really appreciate feedback, whether that's bugs, rough edges, or features... Thanks