title: What is on Ant's classpath for the default java task (fork set to "false")
body: <p>I did the following test:</p>
  
  <h3> code </h3>
  
  <pre><code>public class FooMain {
     public static void main(String args[]) throws ClassNotFoundException {
        Class klass = Class.forName("com.sun.xml.internal.ws.spi.ProviderImpl");
     }
  }
  </code></pre>
  
  <h3>$CLASSPATH environment variable</h3>
  
  <pre><code>echo $CLASSPATH
  /usr/lib/jvm/java-7-openjdk-i386/jre/lib/rt.jar:.
  jar tvf /usr/lib/jvm/java-7-openjdk-i386/jre/lib/rt.jar | grep com.sun.xml.internal.ws.spi.ProviderImpl
  
   1742 Wed Oct 24 18:52:52 EEST 2012 com/sun/xml/internal/ws/spi/ProviderImpl$1.class
   1349 Wed Oct 24 18:52:52 EEST 2012 com/sun/xml/internal/ws/spi/ProviderImpl$2.class
  12412 Wed Oct 24 18:52:52 EEST 2012 com/sun/xml/internal/ws/spi/ProviderImpl.class
  </code></pre>
  
  <p>So the sought class is on the $CLASSPATH.</p>
  
  <p>However running the above code with Ant's <strong>java</strong> task and <strong>fork</strong> set to <strong>"false"</strong> fails and only succeeds if <strong>fork</strong> is set to <strong>"true"</strong>.</p>
  
  <p>This is however is against what's written in the <a href="http://www.amazon.co.uk/Ant-Action-Steve-Loughran/dp/193239480X/ref=sr_1_1?ie=UTF8&amp;qid=1358713527&amp;sr=8-1" rel="nofollow">ANT in Action book</a> where it is noted in pg. 152 that the basic Ant's java task runs with the Ant classpath which includes, among, other things, "everything in the CLASSPATH environment variable".</p>
  
  <p>So why can't Ant's <strong>java</strong> task find the sought-for class when <strong>fork</strong> is set to "false" and succeeds only if <strong>fork</strong> is set to "true" even when the class is on the $CLASSPATH in both cases?</p>