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
- $sudo?-S??
When prompted, enter the administrator password and the prompt will change to
[Plain]? View Plaincopy
- bash-3.2#??
2) Modify BASHRC file read and Write permissions
?
?
[Plain]? View Plaincopy
- 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
- -RW-RW-RW-?? 1?root?? Wheel?? 816?? 1?13?13:55?/ETC/BASHRC??
4) Modify the BASHRC file
?
?
[Plain]? View Plaincopy
- 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
- Export? ant_home=/usr/local/apache-ant-1.9.3??
- 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
- $ant?-version??
The configuration success is shown as follows:
?
?
[Plain]? View Plaincopy
- Apache? Ant (TM)? Version?1.9.3?compiled?on? december?23?2013??
?
Install ant under Mac