title: Jenkins cannot find JUnit (Netbeans+ Git + Ant + JUnit + Jenkins)
body: <p><strong>How do I make Jenkins find JUnit when building with Ant?</strong></p>
  
  <p>Reading the answers <a href="https://stackoverflow.com/questions/6328529/running-jenkins-gives-package-org-junit-does-not-exist">here</a> and <a href="https://stackoverflow.com/questions/1792445/running-ant-build-gives-package-org-junit-does-not-exist">here</a> I believe I have a classpath issue, but I am unable to solve it.  In my Netbeans project I have a single JUnit test which runs fine in Netbeans.  I push the project to my Git repo and Jenkins sees the change and builds the project, but I get a bunch of errors (below) because JUnit is not found.</p>
  
  <pre><code>-do-compile-test:
      [javac] Compiling 1 source file to C:\Jenkins\jobs\demo\workspace\demo\build\test\classes
      [javac] C:\Jenkins\jobs\demo\workspace\demo\test\MainTest.java:6: package org.junit does not exist
      [javac] import org.junit.After;
      [javac]                 ^
      [javac] C:\Jenkins\jobs\demo\workspace\demo\test\MainTest.java:7: package org.junit does not exist
      [javac] import org.junit.AfterClass;
      [javac]  
  
             ^
  </code></pre>
  
  <p>JUnit is in my <code>%ANT_HOME%\lib</code> directory (Windows 7 64 bit).  The file structure for my Netbeans project is like this:</p>
  
  <p><img src="https://i.stack.imgur.com/ACtFu.png" alt="enter image description here"></p>
  
  <p>I have tried to edit the classpath via Ant as discussed here, but I cannot get it working right.</p>
  
  <p>This is my first go with Ant, JUnit, and Jenkins, but I think I'm really close to getting it all working correctly with Netbeans and Git.  I will gladly provide more info.  Been fighting this for 3 days now, so any assistance would be greatly appreciated.</p>