Install Ant under Mac

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/crazybigfish/article/details/18215439

If you don't know what ant is, please don't waste your time reading it. Or what you are interested in ant, you can see here: Wikipedia-ant? or here? baidu-ant


Recently compiled the ant download and installation method, the steps are as follows:


1. Download ant: Download the website

Currently the latest version is Apache Ant 1.9.3, which can download the zip package, such as:


2. Unzip the downloaded zip package into a directory, such as/usr/local. At this time you need to provide modify permissions, enter the password.

Tip: What? Will not enter the USR directory? Open finder, select "Go to" > "Go to Folder" in the menu, or use the shortcut key "Shift+command+g" after you open the Finder and go to the/usr/local directory.

3. Configure Environment variables:

1) Get root privileges

?

[Plain]? View Plaincopy
    1. $sudo?-S??

When prompted, enter the administrator password and the prompt will change to

[Plain]? View Plaincopy
    1. bash-3.2#??

2) Modify BASHRC file read and Write permissions

?

?

[Plain]? View Plaincopy
    1. BASH-3.2#CHMOD?+W?/ETC/BASHRC??

?

3) Review the results after modifying permissions, as shown below, stating that the Modify permission was successful.

?

[Plain]? View Plaincopy
    1. -RW-RW-RW-?? 1?root?? Wheel?? 816?? 1?13?13:55?/ETC/BASHRC??


4) Modify the BASHRC file

?

?

[Plain]? View Plaincopy
    1. BASH-3.2#VI?/ETC/BASHRC??


Press I to enter edit state, add the following two lines at the end of the file

?

?

[Plain]? View Plaincopy
  1. Export? ant_home=/usr/local/apache-ant-1.9.3??
  2. Export? Path=${path}:${ant_home}/bin??


Tip: Where "apache-ant-1.9.3" is the name of the folder you unzipped

?

Press the ESC key to exit the edit state. Input: wq! save and exit.

5) Testing

Re-open the terminal and enter

?

[Plain]? View Plaincopy
    1. $ant?-version??


The configuration success is shown as follows:

?

?

[Plain]? View Plaincopy
    1. Apache? Ant (TM)? Version?1.9.3?compiled?on? december?23?2013??



?

Install ant under Mac

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.