Find the jar file containing a class

13 Jan 2010

SC London
The place where passionate Software Craftspeople, Community, Experts & Thought Leaders come together
Book your ticket now!

I often need to know which jar file contains a particular class and I'm sure most people have that problem at some point. You can use jarFinder but it's not always up-to-date or the class might be in a jar private to your organisation. You can use the following command to do a search on your file systems for all jars, and search in them for the class you're trying to find:

find -name *.jar -print -exec jar tvf {} \; | egrep "\.jar|<Class Name>"

Replace Class Name with the name of your class (Case sensitive). Use cygwin if you are on windows.

Related Blogs

Get content like this straight to your inbox!

Codurance Logo

Software is our passion.

We are software craftspeople. We build well-crafted software for our clients, we help developers to get better at their craft through training, coaching and mentoring, and we help companies get better at delivering software.

Latest Blogs




Contact Us

3 Sutton Lane
London EC1M 5PU

Phone: +44 207 4902967

2 Mount Street
Manchester M2 5WQ

Phone: +44 161 302 6795

Carrer de Pallars, 99
08018, Barcelona

Phone: +34 937 82 28 82

Email: hello@codurance.com