Go to the official website to download the latest version of ant

Unzip the downloaded.tar.gz file:tar zxvf .... tar.gz

Move the extracted files to/opt /:sudo mv apache-ant-1.9.4/opt /

Configure environment variables:sudo vim/etc/environment, add the following text to the original,Then save and exit (part of the jdk installation configuration):

ant_home =/opt/apache-ant-1.9.2

export path=$java_home/bin:$path:$ant_home/bin

export classpath =.:$java_home/lib/dt.jar:$java_home/lib/tools.jar

Type source/etc/environment in the terminal

Verify that the installation was successful:

ant -version

apache ant (tm) version 1.9.4 compiled on april 29 2014

This means that the installation was successful!

  • Previous PHP tree menu code based on recursive implementation
  • Next Summary of several functions of the PHP GD library to generate images