1. Create a folder for ant installation. Here we create an ant folder in the/usr folder temporarily. 2. Download
CD/usr/ant enter the folder and use wget ant to download ant to the current folder. 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 folder.
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 folder. Use the Ln-S-F Android SDK to install the folder/tools/Android and link android to the folder. So far, we can use the ant command in a random folder.
Install ant in centos