title: How to build a distributable jar with Ant for a java project having external jar dependencies
body: <p>I have a Java project in Eclipse with class <code>MainClass</code> having main method in package     :</p>
  
  <pre><code>com.nik.mypackage. 
  </code></pre>
  
  <p>The project also references two external libraries, which I copied in the <code>lib</code> folder in Eclipse and then added to build path using <code>ADD JAR</code> function. The libraries being <code>one.jar</code> and <code>two.jar</code></p>
  
  <p>This library is in <code>lib</code> folder in eclipse and added to the build path.</p>
  
  <p>I want to create a executable <code>JAR</code> of the application using ant script. So that user can access my application using command:</p>
  
  <pre><code>c:&gt;java -jar MyProject-20111126.jar
  </code></pre>
  
  <p>I know about the Eclipse plugin which directly exports a java application as runnable <code>JAR</code>. But I want to learn ant and the build process so manually want to create the build.xm.</p>