Mike Slinn
Mike Slinn

Tracking Down a Mismatched JAR

Published 2011-08-04.
Time to read: 1 minutes.

This page is part of the posts collection, 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:

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

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

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

Run the script like this:

Shell
$ jwhich classNameToFindHere