why maven use jdk 1.6 but my java -version is 1.7

来源:互联网 发布:淘宝店主实拍 编辑:程序博客网 时间:2024/06/06 10:59


119
down voteaccepted

add the following to your ~/.mavenrc:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/{jdk-version}/Contents/Home
shareimprove this answer
 
yes,you answer is correct .The JAVAHOME is required.I edit the /etc/profile instead –  Ninja Oct 13 '13 at 14:36
3 
Well, adding to ~/.mavenrc ensures that other apps are not affected. Only mvn picks up this version of JDK. :) –  MasterGaurav Oct 14 '13 at 2:19
 
Thank you! Finally maven in Eclipse compiles again...! –  jherranzm Apr 12 '14 at 6:11
23 
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) –  jla May 19 '14 at 11:21 
 
wow. this is good. I just realized that the /etc/alternatives mess doesn't help me here. There is no alternative set up for the whole JDK. thanks. Saved me from asking a repeat question. –  Steve Cohen Aug 8 '14 at 23:09 

0 0
原创粉丝点击