安装Apache Maven 由于 JDK 是yum 安装的 并没有 JAVA_HOME 这样的环境变量, 那么需要自己手动添加
- vim /etc/profile
- export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
具体的版本 自己看 /usr/lib/jvm/
- source /etc/profile
- [root@monitoring ~]# mvn -version
- Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
- Maven home: /usr/local/apache-maven
- Java version: 1.8.0_91, vendor: Oracle Corporation
- Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre
- Default locale: en_US, platform encoding: UTF-8
- OS name: "linux", version: "4.4.0-x86_64-linode63", arch: "amd64", family: "unix"
没有评论