tags:

views:

44

answers:

2

Hi guys,

I tried to install Apache Ant on my Mac and I followed the next steps :

I Downloaded apache-ant-1.8.1-bin.tar.gz into my Downloads folder. I moved the file to /usr/local/ using this commands : sudo sh and mv apache-ant-1.8.1-bin.tar.gz /usr/local/ Now I want to use cd /usr/local/ but it's not working, I get back "No such file or directory".

Then I used cd /usr/ and ls commands and it seems that the local folder is there. If I try to access it I get the same error.

Since I already used sudo su why I can't access it ? Any ideas ?

Thanks.

+2  A: 

Do this:

sudo port install apache-ant
Polybos
Thought install MacPorts before you do this http://www.macports.org/
Ceilingfish
+1  A: 

Ant is already installed on Mac OS X, and so it is not necessary to install it yourself. If you absolutely want to install it, though, the best way would be to install it through MacPorts (using sudo port install apache-ant), however, to install it manually, you would need to:

  1. Decompress the .tar.gz file (why did you move it before untarring it?)
  2. Optionally put it somewhere.
  3. Put the "bin" subdirectory in your path.

The commands that you would need, assuming apache-ant-1.8.1-bin.tar.gz were still in your Downloads directory, would be the following (explanatory comments included):

ant --version # Demonstrate builtin version
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
# Demonstrate new version of ant
ant --version
Michael Aaron Safyan
Thank you very much for your help. I didn't know that ant is already installed on my system.I already have Xcode installed, and I needed Ant to setup the environment for GTW and Android development.Thank you.
florinmatinca