title: How to run `ant` build-script without setting any environment variable?
body: <p>I would like to run the <code>ant</code> build-script without installing <code>Java</code> and setting any environment variable like <code>path</code>, <code>JAVA_HOME</code> &amp; <code>ANT_HOME</code> to environment variable. </p>
  
  <p>I have copied already installed folders of <code>Jdk-1.7u17</code>, <code>Jre-1.7u17</code> and <code>apache-ant-1.9.0</code> from one machine to another machine into <code>C:\buildscript_required_files_v2</code> folder. </p>
  
  <p>Now i have a window batch file that gets into the path where build.xml resides and run <code>ant</code> </p>
  
  <pre><code>cd VersionBuild
  C:\buildscript_required_files_v2\apache-ant-1.9.0\bin\ant
  </code></pre>
  
  <p>build.xml complies the Java class and creates a Jar file.</p>
  
  <pre><code>&lt;project name="VersionBuild"  default="clean" basedir="."&gt;
      &lt;description&gt;
          simple example build file
      &lt;/description&gt;
  
    &lt;!-- set global properties for this build --&gt;
  
  
    &lt;target name="init"&gt;
      &lt;!-- Create the time stamp --&gt;
      &lt;tstamp/&gt;
      &lt;!-- Create the build directory structure used by compile --&gt;
  
  
   &lt;/target&gt;
  
   &lt;target name="CompilingBuildversion" depends="init"
          description="compile the source " &gt;
      &lt;!-- Compile the java code from ${src} into ${build} --&gt;
      &lt;C:\buildscript_required_files_v2\java\jdk64\bin\javac.exe srcdir="." destdir="."/&gt;
    &lt;/target&gt;
  
    &lt;target name="Creating jar" depends="CompilingBuildversion"&gt;
        &lt;jar jarfile="VersionBuild.jar"  basedir="."/&gt;
   &lt;/target&gt;    
  
  
   &lt;target name="clean" depends="Creating jar"&gt;
  
   &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>when I am running that bach file, I am getting the following exception - </p>
  
  <pre><code>Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
  b\tools.jar
  </code></pre>
  
  <p>Can I run <code>ant</code> build-script without installing <code>Java</code> and setting any environment variable? Can i specify <code>JAVA_HOME</code> for ant locally into the <code>build.xml</code> so <code>ant</code> can take refrence from <code>C:\buildscript_required_files_v2</code> folder?</p>