Set Java 7 as default JVM on Mac OSX Mountain Lion


I recently had an issue where an application I wanted to run on Mountain Lion needed Java 7 as the default JVM on the machine. The install for the app in question worked without errors, but the issue was highlighted when trying to run the app.

Here’s how I fixed the problem.

Firstly, open Terminal and find out the current default Java version on your machine:

java -version

Download the Java 7 JDK from the Java SE site (http://www.oracle.com/technetwork/java/javase/downloads/index.html)

Run the installer. Now, for me this still didnt ensure that the updated Java version was the current one used by the system.

In Terminal, navigate to the following location:

cd /System/Library/Frameworks/JavaVM.framework/Versions/

The CurrentJDK symlink in this directory was still pointing to an older Java version. To resolve this, remove the symlink and create a new one pointing to the new Java 7 JDK (you may need to use sudo to run these commands):

rm CurrentJDK
ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/ CurrentJDK

This fixed it for me. To confirm, check the Java version once again in Terminal:

java -version



转载地址:http://www.mattgifford.co.uk/set-java-7-as-default-jvm-on-mac-osx-mountain-lion

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值