Adapted from http://ant.apache.org/manual/install.html#installing

Download ant binary distribution here and extract it to a directory in your hardrive

Installing Ant

The binary distribution of Ant consists of the following directory layout:

apache-ant-1.6.0
+--- bin // contains launcher scripts
|
+--- lib // contains Ant jars plus necessary dependencies
|
+--- docs // contains documentation
| +--- ant2 // a brief description of ant2 requirements
| |
| +--- images // various logos for html documentation
| |
| +--- manual // Ant documentation (a must read ;-)
|
+--- etc // contains xsl goodies to:
// - create an enhanced report from xml output of various tasks.
// - migrate your build files and get rid of 'deprecated' warning
// - ... and more ;-)
Only the bin and lib directories are required to run Ant. To install Ant, choose a directory and copy or extract the distribution file there. This directory will be known as ANT_HOME

Setup

Before you can run ant there is some additional set up you will need to do:

กก

Windows and OS/2

Assume Ant is installed in c:\apache-ant-1.6.0\. The following two commands set up the environment for running ant:

set ANT_HOME=c:\apache-ant-1.6.0
set PATH=%PATH%;%ANT_HOME%\bin

When do you type these in? There are several options, depending on your computer and your comfort
with Windows. One option is to type them into a command window each time you open one in order to
run ant (in other words, just before you run ant). A better possibility is to modify your environment variables via Control Panel/Settings/System/Advanced.
If you have never done this before, get help with it.

Unix (bash)

Assume Ant is installed in /usr/local/ant. The following sets up the environment:

export ANT_HOME=/usr/local/apache-ant-1.6.0
export PATH=${PATH}:${ANT_HOME}/bin

Unix (csh)

setenv ANT_HOME /usr/local/apache-ant-1.6.0
set path=( $path $ANT_HOME/bin )