1. 程式人生 > >Ubuntu16中安裝Maven

Ubuntu16中安裝Maven

linux variable open down name ner runt bin 官網

1。官網下載

http://maven.apache.org/download.cgi

apache-maven-3.6.0-bin.tar.gz

2。創建目錄

root@odl_ubuntu:~# mkdir /opt/maven

3。解壓

root@odl_ubuntu:~# tar -zxvf apache-maven-3.6.0-bin.tar.gz -C /opt/maven

4。配置

root@odl_ubuntu:~# vim /etc/profile

在最後增加:

export M2_HOME=/opt/maven/apache-maven-3.6.0

export CLASSPATH=$CLASSPATH:$M2_HOME/lib

export PATH=$PATH:$M2_HOME/bin

立即生效:

root@odl_ubuntu:~# source /etc/profile

5。檢查版本:

root@odl_ubuntu:~# mvn -v
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T11:41:47-07:00)
Maven home: /opt/maven/apache-maven-3.6.0
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-131-generic", arch: "amd64", family: "unix"

Ubuntu16中安裝Maven