Installing and setting ant on Mac OS X

Source: Internet
Author: User

Installing and setting ant on Mac OS X

1. About ant installation on Mac OS X

This is a foreign Article:

Installation of ant on OS X

Recently at work, I had to perform the task of setting up ant on my PowerBook, and I was not satisfied with the tutorials I found online. when I finished setting up everything, I wanted to record the entire procedure for my own sake and also for people who need it. at this point, if you don't know what is ant, you can probably stop reading further. most likely you will not need the knowledge that I am about to share. of course, if you already know how to do this, then please don't waste your time.

Before I get into step-by-step instruction, you need to download ant. And I am assuming you saved it on your desktop. Next, open you terminal and type the following commands:

1. Cd ~ /Desktop
2. sudo sh
3. Music apache-ant-1.6.5-bin.zip/usr/local/
4. CD/usr/local/
5. Unzip apache-ant-1.6.5-bin.zip
6. chown (your account name) :( your account name) APACHE-ant-1.6.5
7. ln-s APACHE-ant-1.6.5 ant

Now, let me explain what each line of command means:

1. navigate to the desktop folder where you saved the ZIP file.
2. authenticate as root/superuser, you will need to type your password to complete the authentication.
3. Move the ant ZIP file to the directory/usr/local.
4. Navigate to directory/usr/local. You can execute LS command to list the content of the current directory just to verify the ZIP file is here.
5. Unzip the ZIP file (pretty obvious ).
6. Change the ownership of the expanded Directory to your regular account, so in the future you can modify the ant folder without authenticating as root again.
7. create a link or alias, this step is optional. after the creation of this link, you can refer to ant directory as/usr/local/ant, instead of/usr/local/Apache-ant-1.6.5.

To test whether everything was done correctly, you can open a new terminal window, and type/usr/local/ANT/bin/ant. you shoshould be able to execute ant if everything is correct. last thing we need to do is to set up our account so we can simply type ant instead of this long command. after all, we are all too lazy to type few more characters.

Assuming the default shell of your terminal is Bash; make sure the following lines are in the bashrc file. You can find the file under/etc.

1. Export ant_home =/usr/local/ant
2. Export path =$ {path }:$ {ant_home}/bin

That's it. to test it, quit all your terminal windows, and then re-open a new one, type ant, you shoshould see an error message complaining that build. XML does not exist. done! I hope this is helpful to someone.

From: http://www.asceticmonk.com/blog? P = 388

2. Install ant on Mac:

In Mac OS X 10.5 (Leopard), ant is the default tool. In this way, you need to know where it is installed by default when you need to make some extensions:

/Usr/shared/ant

Put the *. jar file you want to install in/usr/share/ANT/lib.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.