categories: JDK8,Centos 7,maven
tags: JDK8,Centos 7,maven
我使用centos7X64最小化安装
CentOS-7-x86_64-Minimal-1708
没装jdk的同学,请移步【centos7 安装 jdk8 的正确姿势 并设置开机自启】的文章
yum -y install wget
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
若失效,官网自己查下载地址
maven官网下载需要的版本,这里安装的是二进制包,所以选择“-bin.tar.gz”结尾的包
tar -zxvf apache-maven-3.6.3-bin.tar.gz
mkdir -p /usr/local/maven3
mv apache-maven-3.6.3/ /usr/local/maven3
yum -y install vim
vim /etc/profile
export MAVEN_HOME=/usr/local/maven3
export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
source /etc/profile
mvn -v
[root@50-92 apache-maven-3.6.3]# mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/maven/apache-maven-3.6.3
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /usr/local/java/jdk1.8.0_211/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-693.el7.x86_64", arch: "amd64", family: "unix"
[root@50-92 apache-maven-3.6.3]#