Installing Ant is very simple. Follow the steps given below to install Ant on windows platform:
Download latest ant version from Apache website
Unzip the file on your machine.
Set ANT_HOME in environment variables
Add %ANT_HOME%\bin to your PATH environment variable.
Now open command prompt and enter
ant command. You should see below:
Buildfile: build.xml does not exist! Build failed
Alternatively, using Homebrew on macOS or Linuxbrew on Linux you can simply run:
brew install ant
When using brew it isn't necessary to set up the environment variables.
Several Linux distributions also support installing Ant from their respective package managers.
To test Ant is installed properly navigate to the command prompt and execute
This command will print the Ant version and also shows that Ant was successfully installed.
Ant's own installation instructions page is available on the Apache Ant website.