How to Install Apache Ant on a Mac

Created a video for installing apache ant on Mac running on MacOS Sierra and here is the steps to follow along.

  1. Download Apache Ant to your desktop and unzip the files
  2. Rename the folder to ant
  3. Open the Terminal
  4. Move the files to /usr/local

    [code]sudo mv ~/desktop/ant ~/usr/local/ant[/code]

  5. Fix the permission

    [code]chown -R root:wheel /usr/local/ant[/code]

  6. Edit the bash_profile with your favorite editor

    [code]sudo vi .bash_profile[/code]

  7. Add the path to the ant bin directory

    [code]export PATH=$PATH:/usr/local/ant/bin[/code]

  8. Save and exit your editor
  9. Test out if ant was successfully installed.

    [code]ant -v[/code]


Other Notes: If you are getting an error when you run any commands:

Unable to locate tools.jar. Expected to find it in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/tools.jar

This means you do not have the Java JDK installed. Go to and download and install the JDK.

Edit your bash_profile and update the path for the JAVA_HOME.

[code]export JAVA_HOME=$(usr/libexec/java_home)[/code]

Subscribe to my Youtube channel for more how to video tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *