‘ant’ is not recognized as an internal or external command ‘ant’ is not recognized as an internal or external command windows windows

‘ant’ is not recognized as an internal or external command


ANT_HOME is not being resolved. Change %ANT_HOME%\bin in the Path system environment variable to c:\apache-ant\apache-ant-1.8.2\bin.


I had a similar issue, but the reason that %ANT_HOME% wasn't resolving is that I had added it as a USER variable, not a SYSTEM one. Sorted now, thanks to this post.


create a script including the following;(replace the ant and jdk paths with whatever is correct for your machine)

set  PATH=%BASEPATH%set ANT_HOME=c:\tools\apache-ant-1.9-binset JAVA_HOME=c:\tools\jdk7x64set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%

run it in shell.