Hi All,
I set ANT_HOME path but while trying to use ant -version i get the error "ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME"
Attached pic for reference.
Pls help.
You have ANT_HOME set 2 times :
Set ANT_HOME=C:\ant-apache-1.9.3 either as User variable OR as System variable but not both !
Afterwards put %ANT_HOME%\bin to your System Path variable
ANT_HOME has to be set to the rootfolder of your Ant installation => C:\ant-apache-1.9.3 in your case, it's similar to setting JAVA_HOME.
Including \bin is wrong !
Test your ant installation via cmd :
C:\Users\someuser>ant
Buildfile: build.xml does not exist!
Build failed
=> OK
For more details about your ant installation use :
C:\Users\someuser>ant -diagnostics
------- Ant diagnostics report -------
Apache Ant(TM) version 1.9.3 compiled on December 23 2013
-------------------------------------------
Implementation Version
-------------------------------------------
core tasks : 1.9.3 in file:/C:/ant193/lib/ant.jar
-------------------------------------------
ANT PROPERTIES
-------------------------------------------
ant.version: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
ant.java.version: 1.7
Is this the Apache Harmony VM? no
Is this the Kaffe VM? no
Is this gij/gcj? no
ant.core.lib: C:\ant193\lib\ant.jar
...
You have set the ANT_HOME
, but you haven't added the ANT_HOME/bin
directory to the PATH
variable.
You need to modify your PATH
variable in Environment variables like this
%ANT_HOME%\bin;
Just add it and the end of your PATH
variable value
I've just added the ANT
bin directory to the existing PATH
variable. Please follow this link
Delete the ANT_HOME path variable, the message is ACTUALLY saying it needs to use a project specific path. You are overriding it by setting ANT_HOME.