Newer Version Available

This content describes an older version of this product. View Latest

Prerequisites for Using the Ant Migration Tool

Before you can use the Ant Migration Tool, Java and Ant must be installed and configured correctly. If you already have Java and Ant on your computer, you don’t need to install them, so first verify the installation from a command prompt.

Java

Java version 11 or later is recommended for better security and for the latest TLS security protocols.

To check the version of Java that’s installed on your system:

  1. Open a command prompt.
  2. At the prompt, type java -version and press Enter.
If you have Java version 11, the output looks something like the following.
1openjdk version "11.0.8" 2020-07-14
2OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
3OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)

Ant Migration Tool version 51.0 and later requires Java version 11 or later.

If working with Ant Migration Tool version 36.0 to 50.0, for enhanced security, we recommend Java 7 or later and a recent version of the Ant Migration Tool (version 36.0 or later). Starting with version 36.0, the Ant Migration Tool uses TLS 1.2 for secure communications with Salesforce when it detects Java version 7 (1.7). The tool explicitly enables TLS 1.1 and 1.2 for Java 7. If you’re using Java 8 (1.8), TLS 1.2 is used. For Java version 6, TLS 1.0 is used, which is no longer supported by Salesforce.

Alternatively, if you’re using Java 7, instead of upgrading your Ant Migration Tool to version 36.0 or later, you can add the following to your ANT_OPTS environment variable:

1-Dhttps.protocols=TLSv1.1,TLSv1.2

This setting also enforces TLS 1.1 and 1.2 for any other Ant tools on your local system.

Note

To install Java, go to http://www.oracle.com/technetwork/java/javase/downloads/index.html and get the latest version of the Java JDK. When you’re finished with the installation, verify by typing java -version at a command prompt.

Ant

  1. Open a command prompt.
  2. At the prompt, type ant -version and press Enter.

The output looks something like the following:

1Apache Ant version 1.7.0 compiled on December 13 2006

If the Ant version is 1.5.x or earlier, download the latest version of Ant.

Even if you have Ant installed, you sometimes still need to put the bin directory on your path. On a Windows operating system, you sometimes also need to set the ANT_HOME and JAVA_HOME environment variables as follows.

Note

To install and configure Ant:

  1. Download Apache Ant version 1.6 or later to a directory of your choice: http://ant.apache.org/bindownload.cgi. This directory known as ANT_HOME. When the files are on your computer, no further installation is required.
  2. Add the bin directory to your path. (Only the bin and lib directories are required to run Ant.)
  3. If you are using a Windows operation system, create an ANT_HOME environment variable and set the value to where you have installed Ant. Also create a JAVA_HOME environment variable and set the value to the location of your JDK.

For more information, see http://ant.apache.org/manual/install.html.