Linux CentOS7安装Apache-Ant

1、安装环境

[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core)

需要java环境: https://blog.csdn.net/qq_39680564/article/details/82768938

[root@localhost ~]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

2、获取安装包

ant下载官网:https://ant.apache.org/bindownload.cgi
下载并上传至/usr目录下
在这里插入图片描述

3、修改配置

1、解压、改名

tar -zxvf apache-ant-1.10.5-bin.tar.gz
mv apache-ant-1.10.5-bin.tar.gz ant-1.10.5

2、修改环境变量

vi /etc/profile
export ANT_HOME=/usr/ant-1.10.5
export PATH=$PATH:$ANT_HOME/bin

刷新

source /etc/profile

4、验证

[root@localhost usr]# ant -version
Apache Ant(TM) version 1.10.5 compiled on July 10 2018

猜你喜欢

转载自blog.csdn.net/qq_39680564/article/details/85159725
今日推荐