服务器环境
uname -a Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core)
一些环境下我们还要使用ant,比如tomcat相关库的编译,所以才有了本篇文章
下载安装
curl -X GET http://mirrors.tuna.tsinghua.edu.cn/apache//ant/binaries/apache-ant-1.9.14-bin.zip -o /opt/apache-ant-1.9.14-bin.zip
unzip apache-ant-1.9.14-bin.zip
配置环境
vim /etc/profile
export JAVA_HOME=/script/jdk1.8.0_65 export ANT_HOME=/opt/apache-ant-1.9.14 export CLASSPATH=$JAVA_HOME/lib export PATH=$PATH:$ANT_HOME/bin:$JAVA_HOME/bin
激活环境变量
source /etc/profile
查看是否安装成功
ant -version
参考来源:https://blog.csdn.net/downing114/article/details/51470743