Join our mailing list Subscribe Us

Install apache-ant on MAC



 Apache Ant manually. To do so, you would need to:

  1. Download ant tar from https://ant.apache.org/bindownload.cgi
  2. Decompress the .tar.gz file.
  3. Optionally put it somewhere.
  4. Put the "bin" subdirectory in your path.

The commands that you would need, assuming apache-ant-1.8.1-bin.tar.gz (replace 1.8.1 with the actual version) were still in your Downloads directory, would be the following (explanatory comments included):


# Let's get into your downloads folder.
cd ~/Downloads 

# Extract the folder
tar -xvzf apache-ant-1.8.1-bin.tar.gz 

# Ensure that /usr/local exists
sudo mkdir -p /usr/local 

# Copy it into /usr/local
sudo cp -rf apache-ant-1.8.1-bin /usr/local/apache-ant 

# Add the new version of Ant to current terminal session
export PATH=/usr/local/apache-ant/bin:"$PATH"

# Add the new version of Ant to future terminal sessions
echo 'export PATH=/usr/local/apache-ant/bin:"$PATH"' >> ~/.profile

# Verify new version of ant
ant -version