title: How export Java jar from Eclipse with dependencies on other jars?
body: <p>I am trying to create a self-contained .jar file from an Eclipse project. By "self-contained" I mean that all dependenies of this project (i.e. other jars) should be included in the generated jar. I would like to use the exported jar in another project as a library. 
  The problem is that I get a NoClassDefFoundError for one of the classes from the dependencies. I have tried exporting both a runnable jar with all dependencies packaged into it and a "normal" jar. Neither of these works.</p>
  
  <p>The manifest looks like this: </p>
  
  <pre><code>Manifest-Version: 1.0
  Main-Class: com.path.to.MyMainClass
  Class-Path: lib/resolver.jar lib/xercesImpl.jar lib/xml-apis.jar lib/Mac-Cocoa64/swt.jar  
  </code></pre>
  
  <p>The .classpath look like this: </p>
  
  <pre><code>&lt;classpath&gt;
      &lt;classpathentry kind="src" path="src"/&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/&gt;
      &lt;classpathentry kind="lib" path="lib/resolver.jar"/&gt;
      &lt;classpathentry kind="lib" path="lib/xercesImpl.jar"/&gt;
      &lt;classpathentry kind="lib" path="lib/xml-apis.jar"/&gt;
      &lt;classpathentry kind="lib" path="lib/Mac-Cocoa64/swt.jar"/&gt;
      &lt;classpathentry kind="output" path="bin"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p>The missing class def is from the SWT.jar file. 
  Any idea what might be wrong or what steps I need to take in order to successfully export this jar so that it can be included elsewhere? </p>
  
  <p>Cheers, </p>
  
  <p>Martin </p>