Linux 下安装maven的方法

发布时间:2018-03-07作者:laosun阅读(813)

Linux

Linux 下安装maven的方法,经过本人测试没有问题!

    wget http://mirror.cc.columbia.edu/pub/software/apache/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz

    MAVEN_HOME=/usr/local/maven3export MAVEN_HOMEexport PATH=${PATH}:${MAVEN_HOME}/bin

    首先下载Maven并解压,并移动到usr/local目录下

    $ wget http: / /mirror.bit.edu.cn/apache /maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz $ tar vxf apache-maven-3.2.3-bin.tar.gz $ mv apache-maven-3.2.3 /usr/local/maven3

    修改环境变量,在/etc/profile中添加以下几行

    MAVEN_HOME=/usr/local/maven3export MAVEN_HOMEexport PATH=${PATH}:${MAVEN_HOME}/bin

    记得执行 source /etc/profile 使环境变量生效。

    最后运行 mvn -v 验证maven是否安装成功,如果安装成功会打印如下内容

    Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4;2014-08-12T04:58:10+08:00)Maven home: /usr/local/maven3Java version: 1.7.0_65, vendor:Oracle CorporationJava home: /usr/lib/jvm/java-7-openjdk-amd64/jreDefault locale: en_US, platform encoding: UTF-8OS name: "linux", version: "3.13.0-35-generic", arch: "amd64",family: "unix"


0 +1

版权声明

 linux

 请文明留言

0 条评论