Mac OS X “to open Eclipse, you need a Java SE 6

在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 文件,将这部分

View Code XML
1
2
3
4
<key>JVMCapabilities</key>                     <array>                          <string>CommandLine</string>                     </array>

改为如下:(主要是添加了4行东东)

View Code XML
1
2
3
4
5
6
7
8
<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

标签: Java, Mac

你可能感兴趣的:(Mac OS X “to open Eclipse, you need a Java SE 6)