CentOS7安装Maven
环境信息CentOS Linux release 7.4.1708 (Core)maven 3.3.9安装Maven创建文件夹[vagrant@localhost ~]$ mkdir maven[vagrant@localhost ~]$ cd maven下载Mavenwget http://mirrors.tuna.tsinghua.edu.cn/apache/...
·
环境信息
CentOS Linux release 7.4.1708 (Core)
maven 3.3.9
安装Maven
创建文件夹
[vagrant@localhost ~]$ mkdir maven [vagrant@localhost ~]$ cd maven
下载Maven
wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
下载了安装包
apache-maven-3.3.9-bin.tar.gz
[vagrant@localhost maven]$ ll 总用量 8296 -rw-rw-r-- 1 vagrant vagrant 8491533 11月 18 2015 apache-maven-3.3.9-bin.tar.gz
解压安装包
tar -zxvf apache-maven-3.3.9-bin.tar.gz
配置环境变量
使用vim打开/etc/profile文件
sudo vim /etc/profile
在/etc/profile文件末尾增加以下配置
#maven environment export M2_HOME=/home/vagrant/maven/apache-maven-3.3.9 export PATH=$PATH:${M2_HOME}/bin
使配置生效
source /etc/profile
测试安装
运行命令mvn -v
[vagrant@localhost apache-maven-3.3.9]$ mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /home/vagrant/maven/apache-maven-3.3.9
Java version: 1.8.0_172, vendor: Oracle Corporation
Java home: /home/vagrant/java/jdk1.8.0_172/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-229.el7.x86_64", arch: "amd64", family: "unix"
更多推荐
已为社区贡献1条内容
所有评论(0)