Recently I had to find a jar which contains a java class I was looking for. Previously I was using other utilities like Jarfinder, FindClass etc, but wasn’t very happy.
I found JarScan, which actually works very well and the best part is it is free!. As an example, Under WebLogic 10.0 installation I wanted to find which jar contains the class javax.annotation.PostConstruct. With JarScan you will use,
java -jar /tmp/jarscan.jar -dir /opt/WLPlatform/10.2 -class javax.annotation.PostConstruct
This will return something like,
===============================================
Found: javax.annotation.PostConstruct
Class: javax.annotation.PostConstruct
Package: javax.annotation
Library Name: javax.annotation_1.0.jar
Library Path: /opt/WLPlatform/10.2/modules/javax.annotation_1.0.jar
===============================================
Tags: JarScan, Java Class