1. Create a directory for installing ant. Now, we create the ant directory under the/usr directory. 2. Download
CD/usr/ant to enter the Directory and use wget ant to download ant to the current directory. The ant download page (http://ant.apache.org/bindownload.cgi) is provided ).
The author uses the second
3. Extract
Decompress the compressed package file downloaded from tar-zxvf to the current directory.
4. Configure Environment Variables
Make sure that you have installed JDK and then use Vim to edit the/etc/profile file and add ant to the environment variable:
Export ant_home =/usr/ANT/apache-ant-1.9.4export Path = $ java_home/bin: $ android_home/tools: $ android_home/platform-tools/: $ ant_home/bin: $ path
However, when ant-version is used
Bash: ant: Command not found.Next, let's proceed to the next step.
5. Link file
Run the CD/usr/bin command to enter the directory. Use the Ln-S-F Android SDK to install the directory/tools/Android and link android to the directory. Now, we can use the ant command in any directory.
Install ant in centos