Last active
August 29, 2015 14:17
-
-
Save maheshagodekere/18e8df55f057e0a52034 to your computer and use it in GitHub Desktop.
Finding a class in jars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prints name of the name of the jar | |
grep -l "classname" *.jar | |
# prints package of the class | |
find . -name "*.jar" -exec jar -t -f {} \; | grep "classname" | |
# list all the class files that match a given name: | |
find path/to/libs -name '*.jar' -exec grep -Hls <className> {} \; | |
# JAR could be anywhere in the system use locate and find command: | |
for i in $(locate "*.jar"); | |
do echo $i; jar -tvf $i | grep -Hsi <classname>; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment