title: Exception NoClassDefFoundError
body: <p>I have been working on a mailing app which I would like to compress into a .jar file so that a user can double click to run. I am using the javamail API. In eclipse I "added external jar" and added the mail.jar file and I was able to use all the classes inside of mail.jar while developing in eclipse. Now I want to package them into a jar file, so I used the -jar tool in the command line and I specified a manifest file and all my class files, however when I run the jar, I get this exception: </p>
  
  <pre><code>   Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Multipart
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
      at java.lang.Class.getMethod0(Unknown Source)
      at java.lang.Class.getMethod(Unknown Source)
      at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
      at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
      Caused by: java.lang.ClassNotFoundException: javax.mail.Multipart
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 6 more
  </code></pre>
  
  <p>I know this has something to do with the mail.jar not being in the jar file, and I've tried including the mail.jar file into my application but nothing works. What can I do?</p>