# 下載安裝包地址
https://ant.apache.org/bindownload.cgi
# 選擇相應的版本 我這裏選的是apache-ant-1.10.7-bin.tar.gz
wget -P /home/seven/downloads https://mirror.bit.edu.cn/apache//ant/binaries/apache-ant-1.10.7-bin.tar.gz
# 解壓
tar -zxvf apache-ant-1.10.7-bin.tar.gz
# 轉移
mv apache-ant-1.10.7 /opt/ant
# 環境配置:
vi /etc/profile
export ANT_HOME=/opt/ant
export PATH=$PATH:$ANT_HOME/bin
# 強制刷新
source /etc/profile
# 驗證
ant -version
# 注:
wget命令解析
-P, --directory-prefix=PREFIX save files to PREFIX/...
--cut-dirs=NUMBER ignore NUMBER remote directory components.