How to install Apache Ant in windows7?

In this article we are going to see how can we install Apache Ant in our windows7 PC. I will to keep the step in generalizing form so that if we follow same method, we should be able to install in all other operation systems.

Step 1 : Download necessary installer from this link. I have used latest build(1.9.3), you can use old builds also. I have used zip.

Step 2: Extract downloaded file . I have extracted in my d directory. (D:\apache-ant-1.9.3)

Step 3: Insert extracted location in the system variable.
From my computer(right click) properties -> click advance system properties -> Advance -> Environment variable. Now, click new and add ANT_HOME as variable name and the location as variable value(in my case D:\apache-ant-1.9.3), press ok.

Now , double click on path variable to edit, add %ANT_HOME%\bin (to add, you need to use semi colon (;)as separator) at the end (or any position) of path variable, press ok.

Now, We have ant installed in the system. We have to ensure that JAVA_HOME should in the path variable as ant will use that. To know , how to insert java_home, you may see my this post.

To run properly, we might need to install dependent libraries. To do that, open command prompt, then change directory to extracted location of ant. And, we need to run the fetch.xml stored dependencies. To do that, run this command in command prompt.
ant -f fetch.xml -Ddest=system
It will install dependent libraries which are needed for running ant properly.

So, we are done, ANT is installed in the system. To know more about ant , you may see the extracted directory of ant.  Typically, in the directory we will find bin folder contains all launcher scripts, lib contains ant jars and necessary dependencies , manual contains documentation and etc contains xsl goodies.

Thanks..:)

No comments:

Post a Comment