You get a NoClassDefFoundError , a duplicate-class warning, or a crash log that names com.something.FooHandler and you need one answer: which jar ships that class?
The classic answer is a loop:
for j in libs/*.jar ; do unzip -l "$j" | grep -q 'FooHandler' && echo "$j" ; done
Enter fullscreen mode
Exit fullscreen mode
It works, but it greps zip entry paths, not class names, it misses nested classes unless you remember the $ , and it gets slow once you point it at a full modpack or a Gradle cache.
jdx is a small command-line tool (and MCP server) that reads class names from bytecode and prints the jar on the same line. Here is the whole workflow; the full guide with real output is at Find which JAR contains a class .
One exact name: jdx resolve
jdx resolve FooHandler --jars 'libs/*.jar' --no-jdk
Enter fullscreen mode
Exit fullscreen mode
resolve accepts a simple name, a dotted or binary name, a Type#member , or a package. Each row is kind, canonical name, and the artifact's file name.…