Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANT_HOME is set incorrectly or ant could not be located [duplicate]

Tags:

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

like image 425
SharpAffair Avatar asked Aug 01 '10 15:08

SharpAffair


People also ask

What should ANT_HOME be set to?

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

Where does ant get installed in Linux?

On Windows it would be easy to find the correct folder -- ANT_HOME is the folder, where the installation is stored and looks like C:\Program Files\Apache Ant (or simply the parent directory of the folder with the Ant binaries).


2 Answers

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.

like image 105
Alexander Pogrebnyak Avatar answered Sep 23 '22 18:09

Alexander Pogrebnyak


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.

like image 26
duffymo Avatar answered Sep 22 '22 18:09

duffymo