Installing Ant on Mavericks Mac OS 10.9

January 9, 2014, 9:57 pm
Author: James Griffiths

First things first though; verify that you have Java installed on your Mac by typing the following command in the Terminal application (located in Application/utilities):

java -version.

You should, if Java is installed, see something akin to the following:

If Java is installed then proceed with the following steps, otherwise install Java for Mac OS X 10.9 from the following location:

  1. Download the Apache Ant binary (as of writing the current version is: apache-ant-1.9.2-bin.tar.bz2) from the following location:
  2. Uncompress the downloaded binary package and rename the directory from apache-ant-1.9.2 to ant
  3. In the Terminal application move the downloaded ant directory with the following command (note you must be logged in as an administrator otherwise you will get an error informing you that you don’t have permission): mv /Users/username/Downloads/ant /usr/share/
  4. Assuming there were no problems with running this command now type the following into the Terminal: nano ~/.bash_profile to add path environment variables for the recently installed ant directory
  5. Add the following environment variable to the .bash_profile file: export ANT_HOME=“/usr/share/ant"
  6. Then, on a new line, add the following environment variable: export PATH=$PATH:$ANT_HOME/bin
  7. Save the amended file and exit the nano editor
  8. Now type the following command: source ~/.bash_profile
  9. Open a new Terminal window, navigate to where your Phonegap project build is located - specifically the platforms directory
  10. Enter the following command cordova platforms add android
  11. This might take a few seconds, or slightly longer, but you should now have an android project build directory installed without any errors


« Return to Posts

Post a comment

All comments are welcome and the rules are simple - be nice and do NOT engage in trolling, spamming, abusiveness or illegal behaviour. If you fail to observe these rules you will be permanently banned from being able to comment.