Find a class inside all jars

When having class path issues caused by an old version of a library in your class path, it might be convenient to find all the jars provided this class to figure out what component is loading the old version. So here is a command to do this:

for f in `find /home/jenkins -name '*.jar' -print -exec echo {} \;`; do echo "$f: "; unzip -l $f | grep 'javax.ws.rs.core.MultivaluedMap'; done

Leave a Reply