Prerequisite

Make sure you have a Java environment installed. If you don't have java in your machine, install first before proceeding.

For how to install you can refer Installing Java from my article.

Download Ant

Install Ant

Uncompress the downloaded file into a directory.

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

  1. README, LICENSE, fetch.xml, other text files (contains basic information)

  2. bin (contains launcher scripts)

  3. lib (contains Ant jars plus necessary dependencies)

  4. docs (contains documentation)

  5. etc (contains xsl goodies)

Only the bin and lib directories are required to run Ant. To install Ant, choose a directory and copy the distribution files there. This directory will be known as ANT_HOME.

Setting PATH

Follow the following steps to set up ant path in your machine :

  1. Add the bin directory to your path.

  2. Set the ANT_HOME environment variable to the directory where you installed Ant.

  3. Optionally, set the JAVA_HOME environment variable.

Below is an example snap for clear understanding :

Check Installation

You can check the basic installation with the following :

  1. Open a new shell and type ant
    You should get a message like
    So Ant works. This message is there because you need to write an individual buildfile for your project.
  2. Then type ant -version
    You should get an output like

For more clear please go through Getting Started with Apache Ant

For more details visit Apache's http://ant.apache.org/ webpage.