Installing ANT migration tool in windows

We already looked into installing ANT with support in Linux in this post which is pretty simple fire up some commands in terminal, Boom !!! your Linux machine is ready to rock and roll with ANT. But Windows angry  (which I usually don't prefer for development , but most of the office machines run windows , including mine ) ...  We want to download the required files , tell the operating system the location where the files reside , which is really a step by step process which we are going to do now. 

Ok then , Let me break down the installation into four simple steps

  1. Pre-requirements 

  2. Installing ANT

  3. Setting environment variables

  4. Integrating with


In order to run ANT in your machine you must have Java. To check java is installed and configured in your machine open command prompt and type the following command

java -version

If your command prompt shows the version of the java installed like the following image then, you can move to next step.

If not install java from this link and configure your machine and then follow these instructions.

java version

Installing ANT

Now we want to get the ANT files from this link. Download your desired format and extract in your desired location. You can rename what ever you want, I just renamed to ANT_HOME .

ANT download link

Setting environment variables

Now its time to tell the operating system where to find the ANT files when someone types ant command in the command line.

Right click on the computer icon (May be in desktop or from start menu) and select properties.

Now select the Advanced settings from the left side pane.

In system properties dialog box click on Environment properties in the Advanced tab.

Click on New in the system variables and enter ANT_HOME in  variable name and location of the ant files as shown below and click ok.

Now edit your path variable in user variable or system variable append a semi colon in the end if not present in variable value and append the bin location of ANT files as shown below and click ok.

Open a new command prompt and type the following command 

ant -version

Your command prompt will throw the following message 

Unable to locate tools.jar. Expected to find it in 
C:\Program Files\Java\jre7\lib\tools.jar
Apache Ant(TM) version 1.9.6 compiled on June 29 2015

Now copy the tool.jar from your Jdk -> lib and paste it in jre -> lib location and type the command again. Now it should be resolved.

Integrating with 

Login to your salesforce org and go to Develop -> Tools and download the Migration Tool 


Extract the files and copy the ant-salesforce.jar file and paste it in your ant_home -> lib location.

Now you are ready to rock and roll with ANT. 

ANT will be more useful incase of multi stage deployment from development to QA , QA to Production , etc...

If you like or dislike this post just let me know in comments.

If you want to know about any specific topics hit me on Contact page.

Happy coding laugh .

Average: 5 (3 votes)