Finding things inside jar files

Once again I have to figure out which jar file a given class is in.  This snippet and variations have been used many times.

for JAR in *.jar ; do if [ `jar -tf $JAR | grep -c bouncy` -gt 0 ] ; then echo $JAR ; fi ; done

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.