centos 为OPENJDK配置JAVA_HOME环境变量,安装MAVEN

1、安装开发者工具包

yum install java-1.7.0-openjdk-devel -y

2、配置环境变量

vim /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 
export PATH=$JAVA_HOME/bin:${PATH}

source /etc/profile

3、安装maven

wget http://apache.fayea.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzvf apache-maven-3.3.9-bin.tar.gz

4、配置maven环境变量

export MAVEN_HOME=/data/apache-maven-3.3.9
export PATH=${MAVEN_HOME}/bin:${PATH}

5、配置maven本地仓库的位置

cd /data/apache-maven-3.3.9
vim settings.xml 
--设置本地仓库的位置
<localRepository>/data/maven/repo</localRepository>

mvn -v
mvn clean

posted @ 2016-03-09 09:42  —八戒—  阅读(12840)  评论(0编辑  收藏  举报