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
* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.