在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>

修改后,重启系统,再打开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

相关文章:

  • 2021-12-03
  • 2022-12-23
  • 2021-05-06
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2021-05-14
  • 2021-05-30
猜你喜欢
  • 2022-12-23
  • 2021-09-23
  • 2021-10-24
相关资源
相似解决方案