title: Run ant script from command,error happened:Class not found: org.eclipse.jdt.core.JDTCompilerAdapter
body: <p>In my java web project,there are code like <code>&lt;T&gt;</code> , in ant script, javac use JDK to compile java code, and it can't compile success.</p>
  
  <p>Later,I know it must use eclipse JDT to compile.</p>
  
  <p>And, in eclipse, ant script can run success.when run like this:</p>
  
  <p>Right key click build.xml ---> Run ---> Run as ---> External Tools Configurations,click JRE,select "Run in the same JRE as the workspace".</p>
  
  <p>After that, ant can run successful, in eclipse.</p>
  
  <p>But, I want to write a .bat and .sh file to call ant script, to compile,war,deploy and start Tomcat. 
  So, ant should run from command. I tried more, error happend always:
  Class not found: org.eclipse.jdt.core.JDTCompilerAdapter</p>
  
  <p>PS, I have copy jar files about JDT in eclipse plugin to ant_home/lib directory.</p>
  
  <p>Wish your response. Thanks in advance!</p>
  
  <p>build.xml</p>
  
  <p>`
      
      
      
      
      
      
      
      
      
      
      
      
      </p>
  
  <pre><code>&lt;tstamp&gt;
      &lt;format property="build.time" pattern="yyyy-MM-dd" /&gt;
  &lt;/tstamp&gt;
  
  &lt;path id="project.classpath"&gt;
      &lt;fileset dir="${lib.dir}"&gt;
          &lt;include name="**/*.jar" /&gt;
      &lt;/fileset&gt;
      &lt;fileset dir="${catalina.home}/lib"&gt;
          &lt;include name="*.jar" /&gt;
      &lt;/fileset&gt;
      &lt;fileset dir="${ant.dir}"&gt;
          &lt;include name="**/*.jar" /&gt;
      &lt;/fileset&gt;
  &lt;/path&gt;
  
  &lt;target name="clear"&gt;
      &lt;delete dir="${build.dir}" /&gt;
      &lt;delete dir="${dist.dir}" /&gt;
      &lt;delete file="${catalina.home}/webapps/${webapp.name}.war" /&gt;
      &lt;delete dir="${catalina.home}/webapps/${webapp.name}" /&gt;
  &lt;/target&gt;
  
  &lt;target name="init" depends="clear"&gt;
      &lt;mkdir dir="${build.dir}/classes" /&gt;
      &lt;mkdir dir="${dist.dir}" /&gt;
  &lt;/target&gt;
  
  &lt;target name="compile" depends="init"&gt;
      &lt;echo message="begin compile..." /&gt;
      &lt;javac srcdir="${src.dir}" destdir="${build.dir}/classes" 
          includeantruntime="false" nowarn="on" 
          source="1.6" target="1.6" deprecation="true" debug="true" 
          encoding="UTF-8" classpathref="project.classpath"&gt;
          &lt;compilerarg line="-Xlint:unchecked" /&gt;
      &lt;/javac&gt;
      &lt;copy todir="${build.dir}"&gt;
          &lt;fileset dir="${src.dir}"&gt;
              &lt;include name="**/*.xml" /&gt;
              &lt;include name="**/*.properties" /&gt;
              &lt;include name="**/*.sql" /&gt;
          &lt;/fileset&gt;
          &lt;fileset dir="${config.dir}"&gt;
              &lt;include name="**/*.xml" /&gt;
              &lt;include name="**/*.properties" /&gt;
              &lt;include name="**/*.sql" /&gt;
          &lt;/fileset&gt;
      &lt;/copy&gt;
      &lt;echo message="end compile..." /&gt;
  &lt;/target&gt;
  
  &lt;target name="war" depends="compile"&gt;
      &lt;echo message="begin war..." /&gt;
      &lt;war destfile="${dist.dir}/${webapp.name}.war" basedir="${webRoot.dir}" 
          webxml="${webRoot.dir}/WEB-INF/web.xml"&gt;
          &lt;lib dir="${lib.dir}" /&gt;
          &lt;classes dir="${build.dir}/classes" /&gt;
          &lt;fileset dir="${webRoot.dir}"&gt;
              &lt;include name="***.*" /&gt;
          &lt;/fileset&gt;
      &lt;/war&gt;
      &lt;echo message="end war..." /&gt;
  &lt;/target&gt;
  
  &lt;target name="deploy" depends="war"&gt;
      &lt;echo message="begin deploy..." /&gt;
      &lt;copy file="${dist.dir}/${webapp.name}.war"    todir="${catalina.home}/webapps" /&gt;
      &lt;echo message="end deploy..." /&gt;
  &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>`</p>