one-line JAR Class Finder

how-to
Aug 17, 20081 min

Finding the JAR file with the Class missing from your classpath can become a non-trivial task when dealing with hundreds of JAR files. Special tools like online jarfinder and Eclipse plugin exist. Fortunately for those who run non-Windows OS that task can be reduced to this single-line command, for example: find /usr/local/eclipse_pde/plugins/ -name '*.jar' -exec sh -c 'jar tfv {} | grep CoreException.class && ls {}' ; Furthermore, you can get the feel of how slow JAR is by replacing it with unzip: find /usr/local/eclipse_pde/plugins/ -name '*.jar' -exec sh -c 'unzip -l {} | grep CoreException.class && ls {}' ; The unzip version will run like 100 times faster 😉 Voila!