title: One more Ant/junit ClassNotFoundException
body: <p>I have two identical build files that look like this</p>
  
  <p>build.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project name="Tryout" default="test1" basedir="."&gt; 
      &lt;property name="src" location="src"/&gt;
      &lt;property name="build" location="bin"/&gt;
      &lt;property name="junit" location="junit-4.10.jar"/&gt;
      &lt;target name="compile" description="compile the source" &gt;
          &lt;javac srcdir="${src}" destdir="${build}" debug="on"&gt;
              &lt;classpath location="junit-4.10.jar"/&gt;
              &lt;classpath location="${build}"/&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
      &lt;target name="test1" depends="compile"&gt;
          &lt;junit printsummary="yes" fork="no" haltonfailure="no"&gt;
              &lt;classpath location="${build}"/&gt;
              &lt;classpath location="junit-4.10.jar"/&gt; 
              &lt;formatter type="plain"/&gt;
              &lt;test name="TestOne"/&gt; 
              &lt;test name="TestTwo"/&gt;
          &lt;/junit&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The only difference is in Trial1 the classes are in <code>bin</code>, while in Trial2 the classes are in <code>bin/one/two/three</code> and all the classes are in the package <code>one.two.three</code>.  Trial1 works fine the junit tests run and print the results to a txt file.  Trial2 is able to compile the source to the appropriate folder but then fails when junit executes.  Here is the error:</p>
  
  <pre><code>Testsuite: TestOne
  Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
  
      Caused an ERROR
  TestOne
  java.lang.ClassNotFoundException: TestOne
      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:264)
  </code></pre>
  
  <p>Here's part of the debugging that I think is relevant</p>
  
  <pre><code>Class java.util.ArrayList loaded from parent loader (parentFirst)
  Finding class org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner$3
  Loaded from /usr/share/ant/lib/ant-junit.jar org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner$3.class
  Finding class TestOne
  Class java.lang.System loaded from parent loader (parentFirst)
  Class java.lang.StringBuffer loaded from parent loader (parentFirst)
      [junit] Running TestOne
  Class org.apache.tools.ant.util.StringUtils loaded from parent loader (parentFirst)
  Class org.apache.tools.ant.util.FileUtils loaded from parent loader (parentFirst)
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
      [junit] Test TestOne FAILED
  </code></pre>
  
  <p>Any help to point me in a right direction would be greatly appreciated!!  Thank you for your time.</p>