一、yum安装git最简单

1、在Linux上是有yum安装Git,非常简单,只需要一行命令

yum -y install git

查看git版本:git --version  不知道为啥是二个横杠, git -version无效

微信截图_20200702142500.png

二、CentOS安装Maven3.6.3当前最新版本

 

 

1、下载

Maven官网下载地址:http//maven.apache.org/download.cgi

微信截图_20200702142945.png

也可以通过wget命令下载:

wget https://mirror-hk.koddos.net/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

2、解压 和 移动目录

进入压缩包目录,我上传到/home下了
cd /home
解压
tar -zxvf apache-maven-3.6.3-bin.tar.gz
移动目录:
mv /home/apache-maven-3.6.3-bin /opt/apache-maven-3.6.3

3、配置环境变量

 

在/etc/profile中保存Maven的环境变量:

vim /etc/profile

末尾添加
export M2_HOME=/opt/apache-maven-3.6.3
export PATH=$PATH:$M2_HOME/bin
保存退出

通过source使配置文件生效
source /etc/profile