问题
I downloaded Eclipse (specifically that for C/C++ Programming) for Mac, running OSX Mavericks. When I try to start Eclipse, it gives me this message: "Version 1.6.0_65 of the JVM is not suitable for this product. Version 1.7 or greater is required", and it doesn't open. I installed Java version 7, but nothing changed. I don't know how else to update the JVM (I don't know much about Java in general).
I downloaded the 64-bit version for my MacBook Air, if that matters.
回答1:
Simply Install the JDK 7 or JDK 8, and not just the latest JRE.
回答2:
Run whereis java
in a Terminal. It will normally display something like /usr/bin/java
.
Now run java -version
. It shows you 'java version 1.6.0_65' or something approaching. This is because Java 7 does not replace Java 6. Java 7 is installed as an Internet Plug-in and can be found in /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
.
What you need to do is to symlink /usr/bin/java
to /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
.
Restart Eclipse, or reboot your computer (I don't know how Eclipse manages this), and it should do the trick. :)
回答3:
I went to oracle downloads and the scrolled one of the several Mac osX links and downloaded jdk-8u73-nb-8_1-macosx-x64.dmg from oracle and that fixed the problem. I don't know why updating java doesn't do the trick.
回答4:
add this script into 'eclipse.ini' at the top '/Library/java/JavaVirtualMachines/jdk1.8.0_77.jdk/contents/Home/bin'
回答5:
Trying to install eclipse, I installed java version 1.6.0_65 as it requested yet still was blocked from finishing the Eclipse install with the error that I needed 1.7 JVM or higher - not true, installing higher didn't work either. I tried installing jdk-8u101-macosx-x64.dmg and that didn't work. So, I tried JDK 7 as advised, sorry no good.
So, to get the Eclipse installer to run with out that java error I had to edit the Info.plist inside the Eclipse Installer. Right click the Eclipse installer and show package contents, then open info.plist in textEdit.app
(Note: So after several tries editing this plist and following methods mentioned elsewhere nothing worked, I found that you have to use the symlink or java alias because java is installed differently now a days as an internet plugin.)
Where you want to make an edit (You should probably Backup the original or you can download it again), under <key>Eclipse</key>
, then <array>
, delete out what's there and add <string>-vm</string>
and this string underneath; <string>/usr/bin/java</string>
Here is what mine looks like.
<key>Eclipse</key>
<array>
<string>-vm</string>
<string>/usr/bin/java</string>
<string>-keyring</string>
<string>~/.eclipse_keyring</string>
<string>-showlocation</string>
</array>
Then save and try running your eclipse installer; this worked for me.
回答6:
Just running the below command from there terminal worked for me.
brew cask install java
It updated my idk with 1.8, and after that eclipse opens successfully.
来源:https://stackoverflow.com/questions/25387267/running-eclipse-on-mac-jvm-version-1-7-or-greater-is-required