Installing Apache Ant - TomBekor/Arkanoid GitHub Wiki

Installing Apache Ant

Apache Ant is a software, thus it requires installation wherever you want to use it. We will install the 1.10.7 version.

Pre-requisite

It is assumed that you have already downloaded and installed Java Development Kit (JDK) on your computer.

Download

For Mac users who use brew to install packages (highly recommended in general), you can simply install ant using brew install ant and move to Verify Installation.

For Windows and Linux, proceed as follows:

  • Download Apache-Ant-1.10.7 binaries. It is a zip file.

  • Unzip the zip file to a convenient location (e.g. C:\Users\User). To unzip on Windows, you can use 7-zip or similar programs.

Set environment variables (Windows and Linux)

  • Create a new environment variable called ANT_HOME that points to the Ant installation folder, in our example, the C:\User\User\apache-ant-1.10.7-bin folder.

  • Append the path to the Apache Ant batch file to the PATH environment variable. In our example this would be the C:\User\User\apache-ant-1.10.7-bin\bin folder. You can now run ant commands from anywhere on your system.

If you are not sure how to create or modify an environment variable, here are simple guides for Windows, Linux, and Mac (note you should make it a persistent setting).

Verify Installation

To verify the successful installation of Apache Ant on your computer, type ant -version on your command prompt.

You should see an output similar to −

C:\Users\User> ant -version
Apache Ant(TM) version 1.10.7 compiled on September 1 2019

Integration with IDEs

Common Java IDEs, such as IntelliJ and Eclipse, support the usage of Ant. You can copy the build.xml into your project directory and then edit your build configuration so that it uses Ant targets specified there.
Search the web for a guide if you wish.