title: taskdef class org.testng.TestNGAntTask cannot be found
body: <p>I'm trying to get ant to compile and keep getting:</p>
  
  <blockquote>
    <p>taskdef class org.testng.TestNGAntTask cannot be found</p>
  </blockquote>
  
  <p>Most examples I see have this in the classpath: <code>${libs.dir}/testng-6.8.jar</code></p>
  
  <p>I also tried:</p>
  
  <pre><code>&lt;taskdef name="testng" classpath="${test.classpath}"
      classname="org.testng.TestNGAntTask" /&gt;
  </code></pre>
  
  <p>Parts of my build.xml</p>
  
  <pre><code>&lt;property environment="env"/&gt;
  &lt;property name="ws.home" value="${basedir}"/&gt;
  &lt;property name="ws.jars" value="C:\jars"/&gt;
  &lt;property name="test.dest" value="${ws.home}/build"/&gt;
  &lt;property name="test.src" value="${ws.home}/src"/&gt;
  &lt;property name="ng.result" value="test-output"/&gt;
  
  
  &lt;target name="setClassPath" unless="test.classpath"&gt;
      &lt;path id="classpath_jars"&gt;
          &lt;fileset dir="${ws.jars}" includes="*.jar"/&gt;
      &lt;/path&gt;
      &lt;pathconvert pathsep=":" property="test.classpath" refid="classpath_jars"/&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>What path should I use and how do I know what version of <code>testng.jar</code> I have</p>
  
  <p><a href="https://i.stack.imgur.com/fDPGz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fDPGz.png" alt="enter image description here"></a>
  <sub>Screenshot of my eclipse environment</sub></p>
  
  <p>If I compile with <code>-v</code>, I get:</p>
  
  <pre><code>[echo] classpath------: C:\jars\testng.jar
  </code></pre>
  
  <p>I copied <code>testng.jar</code> to this directory and still no luck.</p>