r/java • • Sep 20 '26

jist - Source aware symbol search for Java classes

https://github.com/Netflix/jist

We've been investigating several approaches for giving agents more efficient insight into Java projects and this tool is part of that work; it also happens to be a really nice way of working with Java classes and sources from the command line, in my opinion.

This tool can take standard javac arguments and allows you to search for symbols, usages and use source scopes to limit how much source detail is output. There are also source aliases like doc that allow for documentation and the signature to be output in a single shot.

jist -s doc java.lang.String.repeat
java.lang.String(String.java:4713):     /**
java.lang.String(String.java:4714):      * Returns a string whose value is the concatenation of this
java.lang.String(String.java:4715):      * string repeated {@code count} times.
java.lang.String(String.java:4716):      * <p>
java.lang.String(String.java:4717):      * If this string is empty or count is zero then the empty
java.lang.String(String.java:4718):      * string is returned.
java.lang.String(String.java:4719):      *
java.lang.String(String.java:4720):      *    count number of times to repeat
java.lang.String(String.java:4721):      *
java.lang.String(String.java:4722):      *   A string composed of this string repeated
java.lang.String(String.java:4723):      *          {@code count} times or the empty string if this
java.lang.String(String.java:4724):      *          string is empty or count is zero
java.lang.String(String.java:4725):      *
java.lang.String(String.java:4726):      *   IllegalArgumentException if the {@code count} is
java.lang.String(String.java:4727):      *          negative.
java.lang.String(String.java:4728):      *
java.lang.String(String.java:4729):      * u/since 11
java.lang.String(String.java:4730):      */
java.lang.String(String.java:4731):     public String repeat(int count) {
33 Upvotes

9 comments sorted by

View all comments

3

u/chabala Sep 20 '26

I see there's like a ja tool for doing the build, and jist doesn't have it's own discussion forum, it redirects back to ja's forum. Java 25 is requred.

I guess my first thought is I'd rather port it to an earlier Java version and make a JBang command for it. I'm not going to adopt another micro-ecosystem for Java tooling.

3

u/BinaryRage Sep 20 '26

It uses the ClassFile API so JDK 25 is the baseline. It’s available either as a standalone jar or jmod archive, so you can bundle it with a JDK, create a standalone runtime image or wrap it in a shell script.

Bundling means that the tool runs on the JDK you’re searching, with sources attached automatically if available. The native launcher with the jmod gives you AOT support too.

0

u/gnahraf Sep 20 '26

The tool's JVM version shouldn't matter. You can use modern versions of java[c] to compile to older versions, also.. not my project, but in principle, I don't see why using a modern runtime should be an issue. Perhaps the project owners can chime in..