Ant is already installed on some older versions of Mac OS X, so you should run ant -version to test if it is installed before attempting to install it.
Alternatively, you can install Apache Ant manually. To do so, you would need to:
Decompress the .tar.gz file.
Optionally put it somewhere.
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):
cd ~/Downloads # Let's get into your downloads folder.
tar -xvzf apache-ant-1.8.1-bin.tar.gz # Extract the folder
sudo mkdir -p /usr/local # Ensure that /usr/local exists
sudo cp -rf apache-ant-1.8.1-bin /usr/local/apache-ant # Copy it into /usr/local
# 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
i use the above technique but you can try and use homebrew http://brew.sh/
I try to follow your step but it doesnt work. Would you mind making a short video for this to show exactly what you are doing?
im so lost with your instruction. I also tried stuff on google but it doesnt help. Can you help me to clear this please!
i need to install and configure ant before i can learn anything. Please help me with this. I am stuck. thank you!
take a look at this tutorial.
http://www.mkyong.com/ant/how-to-apache-ant-on-mac-os-x/