After installing Ant as described in the section called Apache Ant in the chapter called Getting and installing the software, you have to set the ANT_HOME environment variable and update your PATH.
Here are examples to set your environment for Unix and Windows platforms:
Unix platforms: Assuming that you installed Ant in the /usr/local/ant directory, you should perform the following commands:
bash>export ANT_HOME=/usr/local/ant
bash>export PATH=${PATH}:${ANT_HOME}/bin |
or
tcsh>setenv ANT_HOME /usr/local/ant
tcsh>setenv PATH ${PATH}:${ANT_HOME}/bin |
Windows platforms: Assuming that you installed the Ant in the C:\ant directory, you should perform the following commands:
C:>set ANT_HOME=c:\ant
C:>set PATH=%PATH%;%ANT_HOME%\bin |
Note that if you want to set this variable permanently, use the method described in the section called Setting up your Java environment according to your Windows version.