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
    sudo mv ~/desktop/ant ~/usr/local/ant
  5. Fix the permission
    chown -R root:wheel /usr/local/ant
  6. Edit the bash_profile with your favorite editor
    sudo vi .bash_profile
  7. Add the path to the ant bin directory
    export PATH=$PATH:/usr/local/ant/bin
  8. Save and exit your editor
  9. Test out if ant was successfully installed.
    ant -v

 

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 java.com and download and install the JDK.

Edit your bash_profile and update the path for the JAVA_HOME.

export JAVA_HOME=$(usr/libexec/java_home)

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

Post Author: lopau

Leave a Reply

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