title: How to explore which classes are loaded from which JARs?
body: <p>Is there a way to determine which classes are loaded from which JARs at runtime?</p>
  <p>I'm sure we've all been in JAR hell before. I've run across this problem a lot troubleshooting <code>ClassNotFoundException</code>s and <code>NoClassDefFoundError</code>s on projects.  I'd like to avoid finding all instances of a class in JARs and using process of elimination on the code causing a CNFE to find the culprit.</p>
  <p>Will any profiling or management tools give you this kind of information?</p>
  <p>This problem is super annoying purely because we should have this information at the time the class gets loaded.  There has to be a way to get to it, or record it and find it, yet I know of nothing that will do this, do you?</p>
  <p>I know OSGi and versioned bundles/modules aim to make this a non issue... but it doesn't seem to be going away any time soon.</p>
  <p>Note: I found this <a href="https://stackoverflow.com/questions/139534/classloader-issues-how-to-determine-which-library-versions-jar-files-are-load">question</a> is a subset of my question related to classes loaded from versioned jars.</p>
  <p>Somewhat related, this post explains a strategy to search for a class within JARs (either under the current directory) or in your M2_REPO:  <a href="https://stackoverflow.com/questions/759923/jarscan-scan-all-jar-files-in-all-subfolders-for-specific-class">JarScan, scan all JAR files in all subfolders for specific class</a></p>
  <p>Also somewhat related, <a href="http://docs.jboss.org/tattletale/developerguide/en/html_single/" rel="nofollow noreferrer">JBoss Tattletale</a></p>