参考:http://www.bkjia.com/Linuxjc/1134263
参考:http://www.centoscn.com/image-text/install/2014/0722/3331
参考:https://ant.apache.org/manual/install
参考:http://www.cnblogs.com/heaad/archive/2010/11/20/1882864
安装ant:
下载:http://ant.apache.org/bindownload.cgi
wget http://mirrors.tuna.tsinghua.edu.cn/apache//ant/binaries/apache-ant-1.9.7-bin.tar.gz tar -zxvf apache-ant-1.9.7-bin.tar.gz && cp -R apache-ant-1.9.7 /usr/local/ant
环境配置:
编辑 /etc/profile ,在末尾行添加:
#set ant environment ANT_HOME=/usr/local/ant JAVA_HOME=/usr/local/java PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:${ANT_HOME}/bin:$PATH export JAVA_HOME ANT_HOME
保存后,使更改的配置立即生效:
source /etc/profile
测试:
ant
输出:
Buildfile: build.xml does not exist! Build failed
说明ant配置成功。
查看ant版本:
ant -version
输出:
Apache Ant(TM) version 1.9.7 compiled on April 9 2016
安装完成。