Installation

Regardless of platform, downloading Ant is the first step to installing the software. The files can be downloaded to a temporary directory and then uncompressed to any desired directory. After the download step, the process differs depending on whether you’ve downloaded the binary distribution or the source distribution.

Warning

Windows users should avoid directories with spaces such as “Program Files,” as this can cause problems with the provided batch files.

The Ant documentation warns against installing Ant’s JAR files in Java’s lib/ext directory.[7] If you do, you are likely to encounter class-loading problems with some Ant tasks. Instead, you should leave Ant’s JAR files in the Ant distribution directory.

Ant does not provide an installation program; it runs from wherever you choose to copy the files and directories. Table 2-1 lists the directories that ultimately get created under your main Ant directory.

Table 2-1. Directories provided with Ant

Directory

Description

bin

Batch files, Perl scripts, and shell scripts for running Ant.

docs

Ant documentation.

lib

Libraries required by Ant to run.

src

Source code for Ant. Provided only in the source distribution.[a]

[a] Prior to Ant 1.3, source code was included with the binary distribution.

Binary Installation

We will cover the binary installation first, which should suffice for most users. The term “binary” just means that everything is compiled and packaged into JAR files for easy execution — you ...

Get Ant: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.