Centos7 安裝 maven 實踐筆記 自用
阿新 • • 發佈:2021-01-22
技術標籤:centos7javamavenjdktomcat7
title: Centos7 安裝 maven 實踐筆記 自用
categories: [JDK8,Centos 7,maven]
tags: [JDK8,Centos 7,maven]
我使用centos7X64最小化安裝
CentOS-7-x86_64-Minimal-1708
沒裝jdk的同學,請移步【centos7 安裝 jdk8 的正確姿勢 並設定開機自啟】的文章
1.安裝wget
yum -y install wget
2.下載maven
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”結尾的包
3.解壓
tar -zxvf apache-maven-3.6.3-bin.tar.gz
4.移動到/usr/local/maven/apache-maven-3.6.3
mkdir -p /usr/local/maven
mv apache-maven-3.6.3/ /usr/local/maven/apache-maven-3.6.3
5.設定環境變數
yum -y install vim
vim /etc/profile
檔案最後加入:
export PATH=$PATH:/usr/local/maven/apache-maven-3.6.3/bin
6.配置檔案立即生效
source /etc/profile
7.檢視是否安裝成功
mvn -v
[[email protected] 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"
[ [email protected] apache-maven-3.6.3]#