Find the jar file containing a class

13 Jan 2010

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.

Blogs relacionados

Get content like this straight to your inbox!

Software es nuestra pasión.

Somos Software Craftspeople. Construimos software bien elaborado para nuestros clientes, ayudamos a los/as desarrolladores/as a mejorar en su oficio a través de la formación, la orientación y la tutoría. Ayudamos a las empresas a mejorar en la distribución de software.


3 Sutton Lane, planta 3
Londres, EC1M 5PU

Teléfono: +44 207 4902967

2 Mount Street
Manchester, M2 5WQ

Teléfono: +44 161 302 6795

Carrer de Pallars 99, planta 4, sala 41
Barcelona, 08018

Teléfono: +34 937 82 28 82

Correo electrónico: