I read all the possible solutions but the none worked.
I downloaded the ant and put it in C:\ant
(so I have C:\ant\bin
)
On Windows 7 under System variables I have variable called ANT_HOME with value
C:\ant
and variable called PATH with value
%ANT_HOME%\bin
And when I try in cmd (Command Prompt)
ant -version
I get
ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
Also, if I try
echo %ANT_HOME%
I get
C:\ant
I tried PATH = %PATH%;%ANT_HOME%\bin but the same situation. Anyone?
EDIT:
Variables are (name - value):
ANT_HOME - C:\ant
CLASSPATH - .;C:\Program Files\Java\jre6\lib\ext\QTJava.zip
ComSpec - %SystemRoot%\system32\cmd.exe
FP_NO_HOST_CHECK - NO
JAVA_HOME - C:\Program Files\Java\jdk1.6.0_23
NUMBER_OF_PROCESSORS - 2
OS - Windows_NT
PATH - %ANT_HOME%\bin;%JAVA_HOME%\bin
PATHEXT - .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE - x86
PROCESSOR_IDENTIFIER - x86 Family 6 Model 15 Stepping 6, GenuineIntel
PROCESSOR_LEVEL - 6
PROCESSOR_REVISION - 0f06
PSModulePath - %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\
QTJAVA - C:\Program Files\Java\jre6\lib\ext\QTJava.zip
TEMP - %SystemRoot%\TEMP
TMP - %SystemRoot%\TEMP
USERNAME - SYSTEM
windir - %SystemRoot%
XNAGSShared - C:\Program Files\Common Files\Microsoft Shared\XNA\
XNAGSv4 - C:\Program Files\Microsoft XNA\XNA Game Studio\v4.0\
Fix all the environment variables to correct location
ANT_HOME
,JAVA_HOME
,PATH
. Close the command prompt and open a new command window. Try running 'ant' command. It worked for me.To test it : check the versions of JAVA and ANT.
If its showing versions then other commands will also work.
Installing ANT gave me such hard time that I decided to reply to this thread as soon as I get it right.
I was getting the 'ANT_HOME is set incorrectly...'
I tried everything on this thread (almost) like %ANT_HOME%\bin and swapping the JAVA_HOME and ANT_HOME position on PATH variable, setting System variables than User variable etc. Nothing worked.
I downloaded the source distribution and it had no bin folder in it. So I deleted it, downloaded the binary version, unzipped it and set the ANT_HOME to C:\apache-ant-1.7.0 and %ANT_HOME%\bin to PATH under User variable.
It worked for me.
My problem has solved in windows xp, Steps are here (this is my setting change as per your installation):
ANT_HOME
toE:\Software\apache-ant-1.8.4
%ANT_HOME%\bin
;I had been facing the problem : here is my fix that got the ant working.
dowload the proper file
Go to
and download the file
"apache-ant-1.8.2-bin.zip"
Set the following variables in System Environment Variable:
Thank You.
Easy solution:
Use WinAnt installer for Windows. This installation of Ant will automatically install Ant into the
C:\Program Files\WinAnt
path by default. It also sets up yourANT_HOME
andPATH
variables to point at the new installation.Manuall installation:
After installing Ant open the command prompt and type
ant -v
which will print the ant version which means you've successfully configured ant in your windows machine. Some windows may require a restart after setting the enviroment variables.Source: AntOnWindows
On Windows 7 you must run CMD as Adminitrator! When you just click Start and type to search box cmd then Java and ant both not recognized.