views:

179

answers:

3

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

+3  A: 

ANT_HOME might be set, but that doesn't mean the path to /bin is in your PATH so the OS can find it.

Add ANT_HOME/bin to your PATH and the OS will be able to find ant.bat.

duffymo
+1  A: 

Actually ANT_HOME should NOT be set where ant.bat is located.

It should be set to the ant.bat parent directory.

E.g.

C:\apache-ant-1.8.1 <-- ANT_HOME
  |
  bin <-- this is where ant.bat lives.

As duffymo correctly pointed out the ANT_HOME/bin still must be on your PATH.

Alexander Pogrebnyak
A: 

ANT_HOME should be set to the directory where ant is installed. e.g.

If your ant installation is located at: C:\tools\apache-ant

Your ANT_HOME should be set: set ANT_HOME=C:\tools\apache-ant

naikus