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


119
down vote accepted

add the following to your ~/.mavenrc:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/{jdk-version}/Contents/Home
share improve 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 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值