CentOS 安裝 Maven
阿新 • • 發佈:2019-01-01
1、官網找到最新版的安裝包:
拷貝檔名為 *-bin.tar.gz 的連結地址;
2、下載
3、解壓
# tar xvf apache-maven-3.3.3-bin.tar.gz
如果需要:移動到其他目錄
建立軟連線:# ln -s apache-maven-3.3.3 maven
4、配置環境變數
# vi /etc/profile
export M2_HOME=/usr/local/apache-maven
export PATH=$PATH:
$M2_HOME/bin
# source /etc/profile
5、驗證是否安裝成功
# mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
Maven home: /opt/app/maven
Java version: 1.8.0_51, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_51/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-229.el7.x86_64", arch: "amd64", family: "unix"
(原創文章,轉載請註明轉自Clement-Xu的csdn部落格。)