1. Make sure you have properly install java on your machine. To check that, just open a new command promot (Start-> Run -> cmd) and type java -version, it should look like the picture below.
2. Download the Apache Ant zip binary, from here, and I suggest you unzip to a less complex path in your system. I usually use either C:\ or D:\. I also like to rename the extracted folder to something simpler like \ant17. So as you see in the image below i have extracted the contents of the zip, renamed the extracted folder and moved it to C:\ .
3.Make sure you have set the enviroment variable called JAVA_HOME, it is generally a good practise to set it anyway anyhow.Usually this variable points to the top directory of our JDK installation.Right clik on MyComputer ->Properties ->Advanced -> Enviromental Variables -> New User variable -> JAVA_HOME and the path. See the image below.
4. Create the enviroment variable called ANT_HOME. Right clik on MyComputer ->Properties ->Advanced -> Enviromental Variables -> New User variable. See the image below.
5. Edit the variable Path on the System variables section.Just select the Path variable and press Edit.
6.Add the the Path Variable which you have in edit mode the path to the Apache Ant's bin directory. Actually you scroll to the end of the line (it might be big) and you add the following.
Then you just press ok and close the related windows7.Close all the existing command line windows - remember everytime we alter some variables in the system the changes will be only take affect if we open a new command line- the existing one wont have the new updates.In the new window just type ant. You shoud see an error message saying error in build.xml. Yes we are done. This is normal and is properly setup and is just looking for a build.xml to find directives and start working. More on the build.xml file to a later post. You may try typing ant - version, that would print the version of the ant utility.
Thats all, its really easy, if you have any further questions please leave a comment!Happy development with Apache Ant- a java developer's most dedicated...pet!