Java JVM 1.6.0_65 版本不适合本产品
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32159092/
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
Version 1.6.0_65 of the JVM is not suitable for this product
提问by Rockwell Rice
Trying to install eclipse
尝试安装 eclipse
and I get an error
我得到一个错误
Version 1.6.0_65 of the JVM is not suitable for this product.
Java -version from command line says
命令行中的 Java -version 说
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
How can I change that to a compatible version? I did google this and cruise this site for answers with the suggested questions when writing this but was not able to find something that solved it. I found a few answers telling you to do this (with my current installed version in)
如何将其更改为兼容版本?在写这篇文章时,我确实在谷歌上搜索了这个网站,并在这个网站上搜索了建议问题的答案,但找不到解决问题的方法。我找到了一些告诉你这样做的答案(使用我当前安装的版本)
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.*'
When I run the EXPORT command it just takes me to a command line and from there I have no idea what to do.
当我运行 EXPORT 命令时,它只会将我带到命令行,然后我不知道该怎么做。
I did download the 64-bit version.
我确实下载了64位版本。
Seems like it should be an easy thing to do....
看起来这应该是一件容易的事情......
采纳答案by Karthikeyan Vaithilingam
Right click Eclipse
and click Show Package Contents
右键单击Eclipse
并单击Show Package Contents
And open Contents\info.plist
in a texteditor
并Contents\info.plist
在文本编辑器中打开
Then search for <key>Eclipse</key>
and immediately after the <key>Eclipse</key>
you will have <array>
tag, add the following inside <array>
tag.
然后搜索<key>Eclipse</key>
并在<key>Eclipse</key>
您将拥有<array>
标签之后立即添加以下内部<array>
标签。
<string>-vm</string>
<string>YOUR_JAVA_HOME/jre/lib/server/libjvm.dylib</string>
Replace YOUR_JAVA_HOME
with the output of /usr/libexec/java_home -v 1.8.*
. Then eclipse will run on that particular JVM.
替换YOUR_JAVA_HOME
为 的输出/usr/libexec/java_home -v 1.8.*
。然后 eclipse 将在那个特定的 JVM 上运行。
For example my Info.plist has the following
例如我的 Info.plist 有以下内容
<key>Eclipse</key>
<array>
<string>-vm</string>
<string>/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/server/libjvm.dylib</string>
<string>-keyring</string>
<string>~/.eclipse_keyring</string>
<string>-showlocation</string>
</array>
回答by Abhishek Mishra
For Eclipse mars minimum Java required is Java 7 refer the below site
对于 Eclipse mars,最低要求的 Java 是 Java 7,请参考以下站点
回答by Ronaldoh1
Oct 14 - got the same error.
10 月 14 日 - 遇到同样的错误。
You can actually get rid of all the problems by simply installing the appropriate JDK. Make sure you install the full SDK and not the JRE. See Link below.
您实际上可以通过简单地安装适当的 JDK 来摆脱所有问题。确保安装完整的 SDK 而不是 JRE。请参阅下面的链接。
This worked for me - now I'm able to install Eclipse Mars.
这对我有用 - 现在我可以安装 Eclipse Mars。
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
回答by user2961484
You can disable System Integrity Protection and then install the newest version of Java. To disable System Integrity:
您可以禁用系统完整性保护,然后安装最新版本的 Java。要禁用系统完整性:
- Restart your Mac.
- Press "Command + R".
- In the menu bar, find Utilities, and open Terminal.
- Type "csrutil disable; restart".
- 重新启动您的 Mac。
- 按“Command + R”。
- 在菜单栏中,找到实用工具,然后打开终端。
- 键入“csrutil 禁用;重新启动”。
回答by Tim Riley
I was having the same problem. My system: OS X Yosemite Version 10.10.5
我遇到了同样的问题。我的系统:OS X Yosemite 版本 10.10.5
$ /usr/libexec/java_home
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
$ java -version
java version "1.6.0_65"
But www.java.com/verify/ says I have Version 8!? Clearly I have a two versions that are not configured correctly.
但是 www.java.com/verify/ 说我有第 8 版!?显然,我有两个未正确配置的版本。
Here is how I fixed it: Make sure you download the Oracle version of the JDK from a .dmg file. I installed Java SE JDK for Mac OS from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
这是我修复它的方法:确保从 .dmg 文件下载 JDK 的 Oracle 版本。我从http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html为 Mac OS 安装了 Java SE JDK
Then I told java_home to use this new version:
然后我告诉 java_home 使用这个新版本:
$ /usr/libexec/java_home -v jdk1.8.0_111 --exec javac -version
Now:
现在:
$ java -version
java version "1.8.0_111"
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
1.8.0_111, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
1.6.0_65-b14-466.1, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_65-b14-466.1, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
/库/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
... and the Eclipse install works great!
... Eclipse 安装效果很好!
回答by Richard Morgan
Had the same problem. Had downloaded the JRE by mistake because that's what Oracle recommended. Make sure you have the SDK. It's about 500mb.
有同样的问题。错误地下载了 JRE,因为这是 Oracle 推荐的。确保你有 SDK。大约 500MB。
回答by Sidd
You can disable System Integrity Protection and then install the newest version of Java
. To disable System Integrity:
您可以禁用系统完整性保护,然后安装最新版本的Java
. 要禁用系统完整性:
- Restart your
Mac
. - Press
Command + R
. - In the menu bar, find Utilities, and open Terminal. Type
csrutil disable; restart
.
- 重新启动您的
Mac
. - 按
Command + R
。 - 在菜单栏中,找到Utilities,然后打开终端。键入
csrutil disable; restart
。