Mike Slinn
Mike Slinn

Tracking Down a Mismatched JAR

Published 2011-08-04.

This article is categorized under Java

For debugging mismatched jars, first build a list of the jars in question, then run jwhich to discover the jar that provides a specific Java class. Put the jar and the script provided in the download in a directory on your PATH such as /usr/local/bin.

For *nix and Mac, build the list of jars under the current directory like this:

export CLASSPATH=$(find . -name \*.jar -printf %h/%p:)

For Cygwin, build the list of jars under the current directory like this:

export CLASSPATH=$(find . -name \*.jar -printf '%h/%p;')

Run the script like this:

$ jwhich classNameToFindHere