title: ANT checkstyle task: Can't find/access AST Node
body: <p>While trying to setup Hudson to build our projects with ANT I stumbled upon an issue similar to <a href="http://sourceforge.net/p/checkstyle/bugs/683/" rel="noreferrer">this one</a>. The suggested solution there does not work for me, however.</p>
  
  <p>I invoke checkstyle though an ANT task that sets up it's own classpath.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;target name="checkstyle" depends="init, staticAnalysisInit"&gt;
      &lt;mkdir dir="${checkstyle.dir}"/&gt;
      &lt;path id="checkstyle.classpath"&gt;
          &lt;fileset dir="${env.CHECKSTYLE_HOME}"&gt;
              &lt;include name="*.jar"/&gt;
              &lt;exclude name="*all.jar"/&gt;
              &lt;!-- already bundled with ANT distributions and causes problems --&gt;
              &lt;exclude name="antlr*.jar"/&gt; 
          &lt;/fileset&gt;
      &lt;/path&gt;
      &lt;property name="chkstyl.cp" refid="checkstyle.classpath"/&gt;
      &lt;echo&gt;Checkstyle classpath: ${chkstyl.cp}&lt;/echo&gt;
      &lt;taskdef name="checkstyle" 
               classpathref="checkstyle.classpath" 
               classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/&gt;
      &lt;checkstyle config="${env.CHECKSTYLE_HOME}/sun_checks.xml"
                  failOnViolation="false"&gt;
          &lt;formatter type="xml" toFile="${checkstyle.dir}/checkstyle.xml"/&gt;
          &lt;fileset dir="${src.dir}"&gt;
              &lt;include name="**/*.java"/&gt;
          &lt;/fileset&gt;
      &lt;/checkstyle&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>It gives me the following output:</p>
  
  <pre><code>init:
  
  staticAnalysisInit:
  
  checkstyle:
       [echo] Checkstyle classpath: C:\Program Files (x86)\Checkstyle\checkstyle-5.6\checkstyle-5.6.jar;C:\Program Files (x86)\Checkstyle\checkstyle-5.6\commons-beanutils-core-1.8.3.jar;C:\Program Files (x86)\Checkstyle\checkstyle-5.6\commons-cli-1.2.jar;C:\Program Files (x86)\Checkstyle\checkstyle-5.6\commons-logging-1.1.1.jar;C:\Program Files (x86)\Checkstyle\checkstyle-5.6\google-collections-1.0.jar
  [checkstyle] Running Checkstyle 5.6 on 1025 files
  [checkstyle] Can't find/access AST Node typecom.puppycrawl.tools.checkstyle.api.DetailAST
  [checkstyle] Can't find/access AST Node typecom.puppycrawl.tools.checkstyle.api.DetailAST
  [checkstyle] Can't find/access AST Node typecom.puppycrawl.tools.checkstyle.api.DetailAST
  ...
  </code></pre>
  
  <p>The same output is generated inside my IDE (own ANT instance with the same antlr.jar manually added to it's classpath), command line and hudson (the latter two use the usual distribution of 1.8.3 ANT, where antlr is present in <code>$ANT_HOME/lib</code>).</p>
  
  <p>The only way I've managed to get it to work so far is inside IDE (removed manually added antlr.jar classpath entry and used the checkstyle-5.6-all.jar for task classpath). </p>
  
  <p>The same version of antlr is inside both ant and checkstyle distributions. In fact it doesn't work inside my IDE if include either of them in ant library classpath (and don't use checkstyle-5.6-all.jar).</p>
  
  <p>What am I doing wrong?</p>