title: Installing ANT - unable to locate tools.jar
body: <p>I am trying to install Apache Ant on my system, while setting the path variable. I have jdk installed on my system. I set the ANT_HOME environment variable to where ant is located on the system, i.e, <code>F:\apache-ant-1.9.6\</code>, and the path variable to <code>F:\apache-ant-1.9.6\bin</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/eRmF2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eRmF2.png" alt="path variable"></a>
  <a href="https://i.stack.imgur.com/2SdOn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2SdOn.png" alt="ANT_HOME variable"></a></p>
  
  <p>But when I test if ANT is installed correctly by typing <code>ant -version</code> on cmd , I get this error:</p>
  
  <pre><code>Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.8.
  0_25\lib\tools.jar
  Apache Ant(TM) version 1.9.6 compiled on June 29 2015
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/5607664/error-installing-ant-ant-home-is-set-incorrectly">While reading this answer</a>, they say tools.jar in included in jdk and not jre. But I have correctly installed jdk, and set the environment variable correctly for that too.</p>