doina

一个小菜鸟运维工程师.

maven 搭建

安装jdk

tar zxvf jdk-8u45-linux-x64.tar.gz 
mv jdk1.8.0_45/ /usr/local/

vim  /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_45
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

source /etc/profile

[root@baiyongjie src]# java -version         
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

安装maven

cd /usr/local/src/
wget http://mirrors.shu.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
tar zxf apache-maven-3.6.0-bin.tar.gz 
mv apache-maven-3.6.0 /usr/local/maven

vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_45
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export MAVEN_HOME=/usr/local/maven
export PATH=${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${PATH}

source /etc/profile

[root@baiyongjie src]# mvn --version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T14:41:47-04:00)
Maven home: /usr/local/maven
Java version: 1.8.0_45, vendor: Oracle Corporation, runtime: /usr/local/jdk1.8.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-957.el7.x86_64", arch: "amd64", family: "unix"
点赞

发表评论

电子邮件地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据