用于 OS X Mavericks 的 Eclipse Kepler 请求 Java SE 6

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19563766/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 18:22:01  来源:igfitidea点击:

Eclipse Kepler for OS X Mavericks request Java SE 6

javaeclipseosx-mavericks

提问by Piero

I have just made a clean installation of OS X Mavericks, and I have downloaded Eclipse Kepler, but if I execute it, gives me this message:

我刚刚对 进行了全新安装OS X Mavericks,并且已经下载了Eclipse Kepler,但是如果我执行它,则会显示以下消息:

enter image description here

在此处输入图片说明

Asking me to install Runtime Java SE 6; I have already installed Java 7, and if I press Installin that dialog, download and install it, and open Eclipse again, the dialog appears again.

要求我安装Runtime Java SE 6;我已经安装了Java 7,如果我按下Install该对话框,下载并安装它,然后再次打开 Eclipse,该对话框将再次出现。

How I can fix it?

我该如何解决?

采纳答案by Nikolas Grottendieck

This is in part due to Oracle's missing definitions of the JRE8 VM capabilities.

这部分是由于 Oracle 缺少对 JRE8 VM 功能的定义。

In case you don't want to install JRE6 at all and simply use JRE8 without symlinking it to the JRE6 either you can do the following:

如果您根本不想安装 JRE6 而只是使用 JRE8 而没有将其符号链接到 JRE6,您可以执行以下操作:

Copy the Info.plist located at the path named below to e.g. ~/Downloads/:

将位于下面命名路径的 Info.plist 复制到例如 ~/Downloads/:

/Library/Java/JavaVirtualMachines/jdk.1.8.<…>/Contents/

and then replace

然后更换

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

with the following:

具有以下内容:

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

Afterwards copy the file back to its original location (you need administrator rights). For this change to take effect you need to log out of your account (and back in) or restart your computer. The dialog for Java 6 should shouldn't appear anymore and Eclipse should launch just fine using JRE8 (or JRE7). The same holds true for any other application that initially asks for Java, e.g. Adobe's Creative Suite.

然后将文件复制回其原始位置(您需要管理员权限)。要使此更改生效,您需要注销您的帐户(然后重新登录)或重新启动计算机。Java 6 的对话框不应再出现,Eclipse 应该可以使用 JRE8(或 JRE7)正常启动。这同样适用于最初要求 Java 的任何其他应用程序,例如 Adob​​e 的 Creative Suite。

On a related note it appears that this plist change sticks even after updates done through the Java Preference Panel in the System Preferences.

在相关说明中,即使通过系统首选项中的 Java 首选项面板完成更新,此 plist 更改似乎仍然存在。

If it still doesn't work. You might need to add some folders and a symlink (details):

如果还是不行。您可能需要添加一些文件夹和符号链接(详细信息):

sudo mkdir -p /Library/Java/JavaVirtualMachines/jdk1.8.0_*.jdk/Contents/Home/bundle/Libraries
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_*.jdk/Contents/Home/jre/lib/server/libjvm.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0_*.jdk/Contents/Home/bundle/Libraries/
sudo mkdir -p /System/Library/Java/JavaVirtualMachines/1.6.0.jdk
sudo mkdir -p /System/Library/Java/Support/Deploy.bundle

回答by Alexander Poleschuk

To be able to run Eclipse with Java 7 (Oracle), I launch Eclipse using this file: eclipse/Eclipse.app/Contents/MacOS/eclipse. "eclipse" folder contains alias for this file by default. So all that you need to do is to double-click the alias named "eclipse".

为了能够使用 Java 7 (Oracle) 运行 Eclipse,我使用以下文件启动 Eclipse:eclipse/Eclipse.app/Contents/MacOS/eclipse。默认情况下,“eclipse”文件夹包含此文件的别名。所以您需要做的就是双击名为“eclipse”的别名。

Also Oracle warns that Oracle's Java version 7u25 and below have been disabled by Apple on OS X (see here). I had upgraded to the latest JDK version before I found out the way of launching Eclipse with Java 7. So I don't know if the upgrade is necessary or not.

Oracle 还警告说,Apple 在 OS X 上已禁用 Oracle 的 Java 版本 7u25 及以下版本(请参阅此处)。在我找到用Java 7启动Eclipse的方法之前,我已经升级到最新的JDK版本。所以我不知道是否需要升级。

回答by K?re Jonsson

I happened to get it running without a procedure like the suggestions above. I erased the eclipse folder and then copied it back from the trashcan. Please verify if it works for you.

我碰巧在没有上述建议的程序的情况下运行它。我删除了 eclipse 文件夹,然后将其从垃圾桶中复制回来。请验证它是否适合您。

回答by Scott

You need to download and install the JAVA for MAC manually. That is what worked for me.

您需要手动下载并安装 JAVA for MAC。这对我有用。

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

在此处下载:http: //support.apple.com/kb/DL1572?viewlocale=en_US

回答by tristanbergh

On MAC OS X, after installing JRE 7 from Oracle using the .dmg download, on opening Eclipse, it still pointed back to my old JRE 6.

在 MAC OS X 上,使用 .dmg 下载从 Oracle 安装 JRE 7 后,在打开 Eclipse 时,它​​仍然指向我的旧 JRE 6。

After numerous google searches for the problem, and getting here, in desperation I clicked on "Search" in Eclipse --> Preferences --> Installed JREs and voila - it picked up JRE 7.

经过无数次谷歌搜索问题并到达这里后,我绝望地点击了Eclipse中的“搜索”-->首选项-->安装的JRE,瞧-它选择了JRE 7。

回答by Bob Lee

I had this problem after a Mavericks install. I was able to solve it by installing Java from the Apple download at http://support.apple.com/kb/dl1572

安装小牛队后我遇到了这个问题。我能够通过从http://support.apple.com/kb/dl1572的 Apple 下载安装 Java 来解决它

I hope this helps.

我希望这有帮助。

回答by Greg Dubicki

In my case, with Eclipse 4.5.1 Mars(installed from the OS X installer, downloaded from eclipse.org) and OS X El Capitan:

就我而言,使用Eclipse 4.5.1 Mars(从 OS X 安装程序安装,从 eclipse.org 下载)和OS X El Capitan