title: ANT | Trying to override old definition of task javac Error
body: <p>i am trying to build a jar in ANT.Below is my code for generating jar file.i dont know why this error("Trying to override old definition of task javac") happens.sometimes its not generating jar.</p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt; 
  &lt;project name="HelloWorld" default="compress"&gt;
  
      &lt;presetdef name="javac"&gt;
              &lt;javac includeantruntime="false" /&gt;
      &lt;/presetdef&gt;
  
      &lt;target name="init"&gt;
          &lt;mkdir dir="build/classes" /&gt;
          &lt;mkdir dir="dist" /&gt;
      &lt;/target&gt;
  
      &lt;target name="compile" depends="init"&gt;
          &lt;javac srcdir="src" destdir="build/classes"/&gt;
      &lt;/target&gt;  
  
      &lt;target name="compress" depends="compile"&gt;
              &lt;jar destfile="dist/sample.jar" basedir="build/classes" /&gt;
  
      &lt;/target&gt;
  
      &lt;target name="execute" depends="compile"&gt;
          &lt;java classname="src" classpath="build/classes" /&gt;
      &lt;/target&gt; 
  
      &lt;target name="clean"&gt;
  
      &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>The output is as follows:</p>
  
  <pre><code>Buildfile: E:\GAD project\project\GAD\build.xml
  Trying to override old definition of task javac
  init:
      [mkdir] Created dir: E:\GAD project\project\GAD\dist
  compile:
  compress:
        [jar] Building jar: E:\GAD project\project\GAD\dist\sample.jar
  BUILD SUCCESSFUL
  Total time: 1 second
  </code></pre>
  
  <p>Let me know how can i rectify the error msg.?</p>