kristain

博客园 首页 新随笔 联系 订阅 管理

在Mac OS X上,只安装了Java 7而没有安装Java 6时,打开Eclipse等依赖Java的软件,可能会遇到:
To open “Eclipse,” you need a Java SE 6 runtime. Would you like to install one now?
这样的错误提示,经过查找和实验,这里给两个解决方案吧。

1.修改Java安装目录的Info.plist文件:
如,我的系统上是修改:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Info.plist 文件,将这部分

 <key>JVMCapabilities</key>
<array><string>CommandLine</string></array>
 

改为如下:

<key>JVMCapabilities</key><array><string>JNI</string><string>BundledApp</string><string>WebStart</string><string>Applets</string><string>CommandLine</string></array>

修改后,重启系统,再打开Eclipse这样的软件就会正常启动了。

2. 按照提示那样,安装JDK 6吧:
到Apple的官方如下页面下载JDK安装:

http://support.apple.com/kb/DL1572?viewlocale=en_US

安装后,默认就有java 6了,启动Eclipse也不会出问题了。

参考资料:

http://stackoverflow.com/questions/19563766/eclipse-kepler-for-os-x-mavericks-request-java-se-6

http://www.macobserver.com/tmo/article/uninstall-or-disable-java-on-a-mac

posted on 2014-07-24 19:07  kristain  阅读(358)  评论(0编辑  收藏  举报