title: unable to locate tools.jar. Proper solution?
body: <p>I have find so many question related to this in SO.</p>
  
  <p>When i type <strong>ant -version</strong> in the command prompt, the following is printed:</p>
  
  <p><i>Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.8\lib tools.jar</p>
  
  <p>Apache Ant version 1.9.4 compiled on April 29 2014</i></p>
  
  <p><strong>Even though it is saying "Unable to locate tools.jar......" it is also printing the version number.</strong></p>
  
  <p><i>All the other solutions didn't work EXCEPT copying the <strong>tools.jar</strong> from:</i></p>
  
  <p><strong>C:\Program Files\Java\jdk1.8.0_31\lib</strong> and paste it in</p>
  
  <p><strong>C:\Program Files\Java\jre1.8.0_31\lib</strong></p>
  
  <p>After this, when i typed <strong>ant -version</strong>, only <i> Apache Ant version 1.9.4 compiled on April 29 2014</i> is diplayed.</p>
  
  <p>Is this solution recommeded?</p>
  
  <p><strong>FYI:</strong></p>
  
  <p>Before installing jdk 1.8, I had jdk 1.7 and jre 1.8 already installed separately. Now I have all the three inside the same folder <i>C:\Program Files\Java</i>.</p>
  
  <p>In <i>Environment variable->System variables </i>, I have defined:</p>
  
  <p>JAVA_HOME: C:\Program Files\Java\jdk1.8.0_31;</p>
  
  <p>ANT_HOME: <i>ant path</i></p>
  
  <p>And in the <strong>PATH</strong> included <i> C:\Program Files\Java\jdk1.8.0_31\bin; </i>
  and <strong><i>ant bin path</i></strong> also.</p>