title: Using ant to run a custom java task can't find the class files
body: <p>I'm trying to run a custom java task using ant with the custom task already successfully complied into the .class file. This custom task will call another class in an application, in theory running that program via command line.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
     &lt;project default="main" name="myproject"&gt;
      &lt;property name="distDir" location=".\dist\" /&gt;
  &lt;property name="mainDir" location=".\" /&gt;
  &lt;property name="host" value=""/&gt;
  &lt;property name="port" value=""/&gt;
  &lt;property name="dir" value=""/&gt;
  &lt;property name="startTest" value=""/&gt;
  &lt;property name="endTest" value=""/&gt;
  &lt;property name="testOnly" value=""/&gt;
  &lt;property name="userName" value=""/&gt;
  &lt;property name="passwd" value=""/&gt;
      &lt;taskdef name="mytask" classname="Classrunner"&gt;
          &lt;classpath&gt;  
              &lt;fileset dir="${distDir}&gt;
                  &lt;includes="*.jar"&gt;
              &lt;/fileset&gt;
           &lt;/classpath&gt;
      &lt;/taskdef&gt;
      &lt;target name="main"&gt;
          &lt;mytask host="${host}" port="${port}" dir="${dir}" startTest="${startTest}" endTest="${endTest}" testOnly="${testOnly}" userName="${userName}" passwd="${passwd}"/&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The taskdef part of my ant file specifies a fileset that contains a directories that has all the jars in it to run application I'm trying to run. The problem I'm running into is whenever I invoke ant via the command line and pass all the right parameters, and then I get an error saying "java.lang.NoClassDefFoundError: com/pega/fuzz/player/CustomClass"</p>
  
  <p>CustomClass is the class that I call in my custom file and it exists inside that directory of all the jar files so I'm not sure how to specify where it lives since Ant can't find it.</p>