Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Grep Jars For Package Or Class

DZone's Guide to

Grep Jars For Package Or Class

·
Free Resource
Grep a bunch of jars for a certain package or class or expression:


find /path/to/directory -type f -name '*.jar' -print0 | xargs -n1 -0i sh -c 'jar tf "{}" | grep -q query && echo "{}"'


E.g.


find ~/soft/java/maven-repository -type f -name '*.jar' -print0 | xargs -n1 -0i sh -c 'jar tf "{}" | grep -q org.apache && echo "{}"'
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}