Question: How would you go about establishing where a class ( or maybe resource ) has been loaded from?

I am trying to work out exactly where a class has been loaded from. Does anyone know if you can find out the following:

1. Which Jar file did the class come from ?
2. What classloader loaded the file?

Answer: 
For a class one solution is `MyClass.class.getProtectionDomain().getCodeSource().getLocation()`. (Actually, may have a `null` `ProtectionDomain` or that may not hava a `CodeSource`. My also throw a `SecurityException`.
I would go about that with the `-verbose:class` command line option, saving the output to a text file and then use grep (or the DOS find if you are windows) to see details on how that class is loaded.