Setting up Ant

This topic describes how to set up an Ant environment.

The Java Development Kit (JDK) and XSLT processor should be installed before setting up Ant.
Note: The "Full Easy Install" version of the DITA-OT comes with the latest tested versions of Ant, Saxon (a common XSLT processor), and other tools like FOP. If you are using the "Full Easy Install" package, you may run the "startcmd" batch file to set up an environment for all required libraries. When using this method, Java is the only tool that must be installed separately (it cannot be included in the DITA-OT due to licensing restrictions). For a full list of the tools that come in each DITA-OT package, see DITA-OT Packages at
  1. Download and extract the Ant package file (available on into a directory of your choice.
  2. Set up environment variable.
    • On a Windows platform, follow these steps:
      • Set the JAVA_HOME environment variable, if it is not already defined: set JAVA_HOME=<jdk_dir>
      • Set the ANT_HOME environment variable: set ANT_HOME=<ant_dir>
      • Add the Ant binary directory to the PATH environment variable: set PATH=%PATH%;<ant_dir>\bin
    • On Linux, follow these steps:
      • Set JAVA_HOME as follows: export JAVA_HOME=<jdk_dir>
      • Set the ANT_HOME as follows: export ANT_HOME=<ant_dir>
      • Add Ant to the PATH as follows: export PATH=$PATH:<ant_dir>\bin
  3. Optional: If you have installed FOP to generate PDF output, see DITA installation for additional information on setting it up.