title: How to make ANT send the output of a Java program to a particular file?
body: <p>I have a Java program that outputs images in jpg format. As it stands, my ANT script sends all these images to the same file where it writes the compiled java classes (the bin directory, called build.dir in ANT). I want to make it send the images to a separate file called "images". Here are the relevant snippets:</p>
  
  <pre><code>  &lt;property name="source.dir" location="src"/&gt;
    &lt;property name="build.dir" location="bin"/&gt;
    &lt;property name="images.dir" location="images"/&gt; 
    &lt;property name="doc.dir" location="doc"/&gt;
    &lt;property name="main.class" value="project5.Main"/&gt;
  
    &lt;target name="init" description="setup"&gt;
      &lt;mkdir dir="${build.dir}"/&gt;
      &lt;mkdir dir="${images.dir}"/&gt; 
      &lt;mkdir dir="${doc.dir}"/&gt;
    &lt;/target&gt;
  
  &lt;target name="compile" depends="init" description="compile"&gt;
      &lt;javac includeantruntime="false" srcdir="${source.dir}" destdir="${build.dir}"/&gt;
    &lt;/target&gt;
  
  
    &lt;target name="run" depends="compile" description="run"&gt;
      &lt;java dir="${build.dir}" classname="${main.class}" fork="yes"&gt;
          &lt;arg line="${args}"/&gt;
      &lt;/java&gt;
    &lt;/target&gt;
  </code></pre>
  
  <p>I believe it should be added command to the compile task but I cannot find which one.</p>