title: How to include jar lib in my Ant build
body: <p>I have the below build file </p>
  
  <pre><code> &lt;?xml version="1.0" ?&gt; 
  &lt;project name="ClientAdvisor" default="compress"&gt;
  
  &lt;target name="init"&gt;
      &lt;mkdir dir="build/classes" /&gt;
      &lt;mkdir dir="dist" /&gt;
  &lt;/target&gt;
  
  &lt;target name="compile" depends="init"&gt;
      &lt;javac srcdir="src" destdir="build/classes"&gt;
  
      &lt;/javac&gt;
  &lt;/target&gt;
  
  &lt;target name="compress" depends="compile"&gt;
          &lt;jar destfile="dist/clientadvisor.jar" basedir="build/classes"&gt;
  
          &lt;/jar&gt;
  &lt;/target&gt;
  
  
  &lt;target name="clean"&gt;
      &lt;delete dir="build" /&gt;
      &lt;delete dir="dist" /&gt;
  &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>I also have a list of jar files in my lib folder needed to compile my source files. Every time I run the ant command however, I get 'Class does not exist' compile errors. I have tried the following </p>
  
  <pre><code>&lt;target name="compile" depends="init"&gt;
      &lt;javac srcdir="src" destdir="build/classes"&gt;
          **&lt;classpath&gt;
      &lt;pathelement path="lib/*.jar"/&gt;
  &lt;/classpath&gt;**
  
      &lt;/javac&gt;
  &lt;/target&gt;
  
  
   &lt;target name="compress" depends="compile"&gt;
          &lt;jar destfile="dist/clientadvisor.jar" basedir="build/classes"&gt;
               **&lt;zipgroupfileset dir="lib/" includes="**/*.jar" /&gt;**
          &lt;/jar&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>None of this however seems to resolve the problem. What am I doing wrong here? </p>