title: Runnable jar file generated by Eclipse wont execute?
body: <p>I generated a very simple runnable jar file using Eclipse's "Export-->Java-->Runnable Jar File" function.   My HelloWorld class looks like this:</p>
  
  <pre><code>import javax.swing.JFrame;
  public class HWorld extends JFrame {
    public static void main(String[] args) {
      new HWorld();
    }
    public HWorld() {
      this.setSize(200, 100);
      this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      this.setTitle("Hello World!");
      this.setVisible(true);
    }
  }
  </code></pre>
  
  <p>Now, after generating the .jar file , it runs fine from the command line using the command "java -jar HWorld.jar"</p>
  
  <p>But, when I try to execute the jar on its own (which supposedly should work) I get the following error and I don't know why:</p>
  
  <pre><code>E:\Eclipse\workspace&gt;HWorld.jar
  Exception in thread "main" java.lang.NoClassDefFoundError: E:\Eclipse\workspace\HWorld/jar
  Caused by: java.lang.ClassNotFoundException: E:\Eclipse\workspace\HWorld.jar
          at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
  Could not find the main class: E:\Eclipse\workspace\HWorld.jar.  Program will exit.
  </code></pre>
  
  <p>My manifest looks like this:</p>
  
  <pre><code>Manifest-Version: 1.0
  Rsrc-Class-Path: ./
  Class-Path: .
  Rsrc-Main-Class: HWorld
  Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
  </code></pre>
  
  <p>The only thing that looks really fishy to me is this (since a .jar is not a .class):</p>
  
  <pre><code>Could not find the main class: E:\Eclipse\workspace\HWorld.jar
  </code></pre>
  
  <p>Looking for ideas or thoughts or even an answer!   I tried to give as much info as possible in hope of a quality answer.  This thread implies that it should work but doesn't answer my question:  <a href="http://forums.oracle.com/forums/thread.jspa?threadID=2152988" rel="nofollow">http://forums.oracle.com/forums/thread.jspa?threadID=2152988</a> .  Can anyone else try it in their Eclipse?</p>