title: Load class within Jar file and get it's path
body: <p>I know there are already a lot similar questions here, but I couldn't get any smarter form them. I want to load a class inside a jar file, at this point this is no problem, but when I want to pass the path to my own ClassLoader it throws an exception it cannot find the class. Is it possible to load a class inside a jar using an absolute path? For instance,<br><code>Class cls = loader.loadClass(/path/MyPlugin.jar/MyPlugin.class);</code></p>
  
  <p>But when I do this: </p>
  
  <pre><code>File test = new File("path/plugins/MyPlugin.jar/MyPlugin.class");
  System.out.println(test.exists());
  </code></pre>
  
  <p>It prints out false. I tried using <code>MyPlugin.jar!/MyPlugin.class</code> or <code>MyPlugin.jar.jar!MyPlugin.class</code> which i've seen sometimes on the web, even though i don't really know what it means...<br><br></p>
  
  <p>When I do this it finds the class:</p>
  
  <pre><code>URLClassLoader loader = new URLClassLoader(new URL[] { "path/plugins/MyPlugin.jar" });
  Class cl = loader.loadClass("MyPlugin");
  </code></pre>
  
  <p>But now, how can I receive the path? Something like <code>URL url = cl.getResource("MyPlugin");</code> (which gives back a null)</p>