Typically in a development environment of a big J2EE product, you often cross the step of including the right jars in your library path to get your product compile/run/debug. With lot of jars lying in you lib folder, you face the daunting task of including the needed few.
In case if you want to find from which jar a particular class gets picked up, you face the same daunting task of opening the various jars and looking out for a particular class file packaged inside it.
To get rid of this one, I came up with a java program that takes a path and class name and spits out the jars which contains the class. The usage of FindClass is simple
java FindClass C:\j2ee\product\lib MyClass
FindClass iterates through the folder (and subsequent subfolders) to get the list of available jars and list out the jars, which contains the specified class.
I used JarFile and JarEntry to read a jar file. Rest is all simple File operations.
If you love to use this util class, drop a comment.