Please follow the steps below to setup ant in your machine
- Download ANT from http://ant.apache.org/bindownload.cgi
- Extract the downloaded zip file somewhere like C:\apache-ant-1.9.4-bin\apache-ant-1.9.4
- Set this path in system variables as ANT_HOME.
- If PATH system variable already exists then add %ANT_HOME% to your path variable, else add new PATH variable and keep this value.
- Also create a JAVA_HOME environment variable and set the value to the location of your JDK.
- Go to command prompt and type ant -v. If it shows that ‘Apache Ant Version compiled’ then that means we are good to go.
- Till here you have downloaded and configured the required steps for ANT. Now you have to download the Force.com migration tool from your salesforce org ( it can be any org ). Go to Your Name > Setup > Develop > Tools.
- Click the “Force.com Migration Tool” link to download a zip file. Inside this zip file you can find the ant-salesforce.jar file and some sample configuration files.
- Copy the jar file mentioned above and paste it into the lib folder of your ant installation direcotry ‘C:\apache-ant-1.9.4-bin\apache-ant-1.9.4\lib‘.
- Now, you are ready to use ANT with force.com migration tool. You can now deploy or retrieve your salesforce.com Metadata using ANT and command prompt.
Retrieve Code
Deploy Code