简体   繁体   English

在OSX上安装Java for Eclipse

[英]Installing Java for Eclipse on OSX

I've been trying to install Java, mainly for Eclipse, in the latest OSX (10.11) but it just wont work. 我一直在尝试在最新的OSX(10.11)中安装主要用于Eclipse的Java,但是它无法正常工作。 I installed JRE 8 and 7 and when I launch Eclipse it says that the Java version isn't suitable for it (Says I have 1.6.0_65 ) and that I need version 1.7 or higher . 我安装了JRE 8和7 ,当我启动Eclipse时,它说Java version isn't suitable for it (说我有1.6.0_65 ),我需要version 1.7 or higher Then I tried to install the JDK 7 and 8 . 然后,我尝试安装JDK 7和8 Both installers get stuck on 两个安装程序都卡在

Verifying JDK 7/8 Update xx.pkg

and wont move on. 并不会继续前进。 I don't know what else to do. 我不知道该怎么办 Can anyone help me? 谁能帮我?

Thank you, Vasco 谢谢你,瓦斯科

I just had the same problem trying to open the JDK 8 Update 211.pkg . 尝试打开JDK 8 Update 211.pkg我遇到了同样的问题。 I uninstalled the Java JRE using the comand line instructions here . 我使用此处的命令行指令卸载了Java JRE。 I then restarted my machine, and tried opening the JDK 8 Update 211.pkg again and it worked right away. 然后,我重新启动计算机,并尝试再次打开JDK 8 Update 211.pkg ,它立即起作用。

You can specify which JVM Eclipse should use via eclipse.ini . 您可以通过eclipse.ini指定应使用哪个JVM Eclipse。 That might get you going using the Java 7 or 8 JRE's that you installed, but if you're going to use Eclipse for any Java-based development you'll really want the JDK instead. 这可能会帮助您使用已安装的Java 7或8 JRE,但是如果要将Eclipse用于任何基于Java的开发,则实际上需要JDK。 So you should pursue why the JDK installations are failing on your machine (probably another SO question). 因此,您应该继续研究为什么JDK安装在您的计算机上失败(可能是另一个SO问题)。

您应该使用此链接到Apple,为您的Mac下载正确的Java: https : //support.apple.com/kb/DL1572?locale=zh_CN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM