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 wgetant 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. decompress and use t 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:
[Html]View plaincopyprint?
- Export ANT_HOME =/usr/ant/apache-ant-1.9.4
- Export 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.