Today, a colleague of me teached me some useful commands to execute operations on JAR files
Searching for a class file in a bunch of JAR files
I needed this, as I was looking for a class in the lib folder of JBoss. The lib folder contains a lot of JAR files, so it was rather impossible to search them individually:
<a href="mailto:jochen@baileys">jochen@baileys</a> lib $ grep -ri TreeCacheProvider . Binary file ./jboss-hibernate.jar matches Binary file ./hibernate3.jar matches Binary file ./hibernate-jbosscache-3.3.2.GA.jar matches
Searching for the full package name of a class in a JAR file
Ok, so with the command above, I know TreeCacheProvider is in 3 JAR files, but I want to know the full qualified package name?
<a href="mailto:jochen@baileys">jochen@baileys</a> lib $ jar tvf jboss-hibernate.jar | grep TreeCacheProvider 3232 Fri Jul 18 14:20:44 CEST 2008 org/jboss/hibernate/cache/DeployedTreeCacheProvider.class