title: "Package * does not exist" when running ant compile
body: <p>Using ant to compile (<code>ant compile</code>) a project where I have multiple src folders that need to be built each into their own classes folder.  Example:</p>
  
  <pre><code>.
  |-- classes1/com
  |   `-- A.class
  |-- classes2/com
  |   `-- B.class
  |-- src1/com
  |   `-- A.java
  `-- src2/com
      `-- B.java
  </code></pre>
  
  <p>The problem that I'm running into is that B.java uses the class defined in A.java, and when compiling B.java it's throwing <code>package com.A does not exist</code>.</p>
  
  <p>Here is what my ant snippet looks like:</p>
  
  <pre><code>&lt;path id="classpath"&gt;
      &lt;fileset dir="lib"&gt;
          &lt;include name="*.jar" /&gt;
      &lt;/fileset&gt;
      &lt;fileset dir="."&gt;
          &lt;include name="**/*.classes" /&gt;
      &lt;/fileset&gt;
  &lt;/path&gt;
  
  &lt;target name="compile"&gt;
      &lt;javac srcdir="src1" destdir="classes1" includeantruntime="false"&gt;
          &lt;classpath refid="classpath" /&gt;
      &lt;/javac&gt;
      &lt;javac srcdir="src2" destdir="classes2" includeantruntime="false"&gt;
          &lt;classpath refid="classpath" /&gt;
      &lt;/javac&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>When I run <code>ant -v compile</code> I can even see classes1/com/A.class in the classpath</p>