'Unable to install Apache Ant

i have downloaded the Apache Ant file "apache-ant-1.8.4-bin.zip" from the following link :- http://ant.apache.org/bindownload.cgi. then i have added an environment variable to my windows 7 operating system:-

Name = ANT_HOME Value = C:\

but when i typed the following using CMD command line:-

C:\apache-ant-1.8.4-bin\apache-ant-1.8.4\bin>ant.bat

i got the following error: -

ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.

So what might be going wrong? BR

ant


Solution 1:[1]

Your ant home is:

C:\apache-ant-1.8.4-bin\apache-ant-1.8.4\

Create environment variable ANT_HOME with this value. Don't forget to re-open cmd window after.

Solution 2:[2]

Per Krestens answer, your ANT_HOME variable needs to be the base dir where ant was unzipped. Then your PATH (either user or system) needs to add

%ANT_HOME%\bin;

That will allow you to call ant.bat (how ant starts on a windows system).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eugen Martynov
Solution 2 JasonRobinson