This question already has an answer here:
I'm trying to build a project in Ant, using BuildFile (build.xml). Although ANT_HOME environment variable clearly exists and is set to the path where "ant.bat" is located, it always displays this error message. How to configure Ant properly to compile builds in Windows?
Thanks
If you are using Bamboo, make sure that the ant path in Bamboo setting is the same as your ANT_HOME.
The
ANT_HOME
variable has to be a reference to the directory where thebin
folder is found such asC:\Apps\apache-ant-1.8.4-bin\apache-ant-1.8.4\
The
PATH
reference can than be a reference to theANT_HOME
variable and thebin
folder such as%ANT_HOME%\bin
example:
Check your existing PATH that may already included. Ant will not work if path is duplicated.
I had the same problem and none of these solutions worked, so i simply deleted my ANT_HOME from enviroment variables, restarted my PC and I was all set to go
Actually ANT_HOME should NOT be set where ant.bat is located.
It should be set to the ant.bat parent directory.
E.g.
As duffymo correctly pointed out the ANT_HOME/bin still must be on your PATH.
Just sharing my experience, using
cd %ANT_HOME%
can point out errors in setting the variable correctly.%ANT_HOME%\bin