Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
Created January 20, 2009 15:15
Show Gist options
  • Save matthewmccullough/49514 to your computer and use it in GitHub Desktop.
Save matthewmccullough/49514 to your computer and use it in GitHub Desktop.
Look for JARs containing a class name
#!/bin/sh
#Example Usage: findjars com/ambientideas/groovy
CLASSNAMETOFIND="$1"
echo "Searching all JARs recursively..."
for eachjar in `find . -iname "*.jar"`
do
#echo "Searching in $eachjar ..."
jar tvf $eachjar | grep $CLASSNAMETOFIND > /dev/null
if [ $? == 0 ]
then
echo "******* Located \"$CLASSNAMETOFIND\" in $eachjar *******"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment