Which4J can be run in command-line mode to search your system classpath for all occurrences of the specified classname. More importantly, it can also be used programmatically to search a particular ClassLoader for the first occurrence of the specified classname or Class instance. This can be extremely valuable when trying to debug problems in web containers and application servers that have sophisticated ClassLoader hierarchies.
The following snippet of code shows how simple it is to figure out where a particular classloader is loading a particular class from:
System.out.println(org.theshoemakers.which4j.Which4J.which( java.lang.String.class ) );
And here is the output: