Sakibul Hasan

Dont be a Pithagorian, be for others

Install Apache Ant on Mac OS X

Do the following steps to install Ant on your Mac OS X:

    • Get the latest version of Apache Ant (binary distribution) from its official website (example link)
    • Unzip the binary distribution and rename the folder to “ant”
    • move the folder to “/usr/local”. terminal commands:

mv ant /usr/local

    • create a link of that folder after going to that folder. terminal commands:

cd /usr/local
ln -s ant ant

    • Open “bashrc” file located inside “/etc” and append the following lines in the end

export ANT_HOME=/usr/local/ant
export PATH=${PATH}:${ANT_HOME}/bin

    • Now close current terminal and open a new one. Now if you type “ant” in the new terminal and get a message “build.xml does not exist” then you have done it!
Advertisement

12 Responses to Install Apache Ant on Mac OS X

  1. maya March 26, 2011 at 9:05 pm

    there’s not file “bashrc” in my dir “etc”…

    these are the files in “etc”:

    ant-bootstrap.jar jdepend-frames.xsl junit-noframes.xsl tagdiff.xsl
    changelog.xsl jdepend.xsl log.xsl
    checkstyle junit-frames-xalan1.xsl maudit-frames.xsl
    coverage-frames.xsl junit-frames.xsl mmetrics-frames.xsl

    thank you..

  2. Sakib March 27, 2011 at 12:18 am

    bashrc is a hidden file. The name of the file should be ‘.bashrc’. open a command promt, go to the specified directory and type “ls -a”. You will see the file named “.bashrc”.

  3. harpreet May 8, 2011 at 5:29 pm

    hello,
    Thanks a lot bro…. this utorial helped me alot…. i was able to get in one shot ….
    nice job

  4. Sakib May 8, 2011 at 7:08 pm

    you are welcome Harpreet :)

  5. Daudi May 21, 2011 at 5:38 pm

    Thanks for this tip. I’m a newbie mac developer and I was able to install ant in one go using your tip.

  6. Susanne May 30, 2011 at 6:29 pm

    Thank you so much!!! Helped a lot :-)

  7. Frederik June 3, 2011 at 11:43 am

    I tried to do it, but it says
    mv: rename ant to /usr/local: Permission denied

    Something with chmod?

  8. Frederik June 3, 2011 at 11:52 am

    I solved it buy just put the ant map with my documents and go to my documents map in the terminal.

    export ANT_HOME=ant
    export PATH=${PATH}:${ANT_HOME}/bin

  9. Ana42 July 14, 2011 at 4:18 pm

    Thank you So much it’s so simple ;)

  10. Basem December 9, 2011 at 12:22 pm

    Thanks buddy that easy and fast to do ;)

  11. Kevin December 12, 2011 at 11:31 am

    Ant is already installed on your Mac. You just have to set ANT_HOME to point to /usr/share/ant

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.