23

Still trying to get Eclipse IDE to work and running into Incompatible JVM error. I followed the steps here: I installed Java 7 but Eclipse keep saying that 1.6 is not suitable for this product

But unfortunately to no effect. Running OSX 10.9.5 and uninstalled the out-of-the-box version of Mac. The new version of Java seems to show up in the System Preferences. Please see attached screen capture. I've even done some of the basics like restart my computer, etc. Maybe there are other modifications I need to make to other files. I'm comfortable with Terminal but new to Eclipse and Java. Screen shot of Terminal, System Preferences and Eclipse error message

starball
  • 20,030
  • 7
  • 43
  • 238
joseph_pindi
  • 857
  • 2
  • 10
  • 22
  • Open a new terminal and run `java -version`. What does it say? – jheimbouch Feb 06 '16 at 21:53
  • I don't have access to Mac, so can't test this out, but a senior contributor on the Eclipse Forums [had this to say](https://www.eclipse.org/forums/index.php?t=msg&th=1073452&goto=1718965msg_1718965): "so the best thing is to download JDK 1.8 (not just the JRE)" – Jonah Graham Feb 06 '16 at 21:59
  • @JonahGraham you need JDK in the first place anyway, You can't run eclipse or any other IDE without JDK – Maciej Cygan Feb 06 '16 at 22:02
  • @MaciejCygan of course you can :-) you definitely do not need JDK in general to run Eclipse. You may _want_ it for Java development, but Eclipse is a lot bigger than just Java. I defer to Eric on the forums as to the reason he recommends JDK on Mac, is it something about Macs? – Jonah Graham Feb 06 '16 at 22:04
  • @JonahGraham actually i suppose yes JRE is sufficient to open up eclipse. But why one would download eclipse and use it for something else where other 'better' IDE's exists for other languages. – Maciej Cygan Feb 06 '16 at 22:09
  • @MaciejCygan well you don't even need Jedi for Java dev in eclipse, not that I would take someone seriously who did not have jdk installed! I won't argue about best IDEs in general (partially because I don't actually disagree) but Eclipse CDT is the "best" IDE for C/C++ in embedded market. Anyway way OT as OP did imply Java dev. – Jonah Graham Feb 06 '16 at 22:16
  • "java -version" gives the old java version in spite of my uninstalling it. I'm just looking to create some MineCraft mods. Should I be trying to install the JDK, too, or is that unnecessary, given that I already have Eclipse installed? – joseph_pindi Feb 07 '16 at 00:00
  • @joseph_pindi can you please do a print script of both java -version & javac -version and paste it in your answer – Maciej Cygan Feb 07 '16 at 00:07
  • [Josephs-MacBook-3:/Library/Java/Extensions] admin% java -version java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode) [Josephs-MacBook-3:/Library/Java/Extensions] admin% javac -version javac 1.6.0_65 – joseph_pindi Feb 07 '16 at 01:00

7 Answers7

42

I have had the same problem as noted above. I could not get Eclipse to install because of Java incompatibilities. The sequence I followed goes like this:

  1. Upgraded to MAC OS Sierra
  2. Downloaded the Eclipse installer but was prompted that I needed to instal a legacy Java.
  3. Installed Java 1.6
  4. Was unable to install Eclipse and was prompted that I needed Java 1.7 or greater. Downloaded and installed Java 1.8
  5. Ran the terminal code 'java -version' // this will check your jre version. This showed returned Java 1.6 despite the fact that I had upgraded to 1.8. The Java version listed in the Java control panel said 1.8
  6. Tried multiple downloads of eclipse and Java and multiple restarts always with the same result.
  7. Visited the Oracle web page noted above: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html I could not find the above reference to 8u73 and 8u74 but I did find and option to download 1.8.0_12. I did this. It installed without difficulty, and then I was able to install Eclipse without difficulty.

This took hours of my time. I hope this proves useful.

John
  • 527
  • 1
  • 4
  • 4
22

OK, so I don't really know what the problem was, but I simply fixed it by navigating to here http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and installing 8u74 instead of 8u73 which is what I was prompted to do when I would go to "download latest version" in Java. So changing the versions is what did it in the end. Eclipse launched fine, now. Thanks for everyone's help!

edit: Apr 2018- Now is 8u161 and 8u162 (Just need one, I used 8u162 and it worked.)

Joel
  • 197
  • 1
  • 10
joseph_pindi
  • 857
  • 2
  • 10
  • 22
19

JRE is a Run-Time Environment for running Java stuffs on your machine. What Eclipse needs is JDK as a Development Kit.

Install the latest JDK (and not JRE) from http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html and you should be good on Mac!

Aidin
  • 25,146
  • 8
  • 76
  • 67
2

Open up terminal and check what java version is currently set in your path variable.

You can do that by typing in your terminal

java -version // this will check your jre version. 
javac -version // this will check your compiler version

If this shows incorrect java version but you have installed java 1.8 then you have to set path variable to the newer version of java.

To do that do add the line:

export JAVA_HOME=/path/to/java/jdk1.x

to ~/.bash_profile (same as /Users/username/.bash_profile)

Then do this from the terminal to set the new variable

source ~/.bash_profile

Also what's your eclipse.ini set to ?

-Dosgi.requiredJavaVersion=1.7

EDIT:

Please open up terminal and type

 find / -name "java" // This should find all folder named java on your file system.

Also how did you install java in the first place ?

Maciej Cygan
  • 5,351
  • 5
  • 38
  • 72
  • @jheimbouch - You can export a variable temporarily in the terminal. You forgot that you need to source the profile file, though in your edit – OneCricketeer Feb 06 '16 at 22:07
  • The Java installer "installs" Java but I can't find the file path to it. I go into Library/Java and there is nothing there (except for the three sub-folders but they appear to be empty. So either it is installing it in some non-standard place, or not installing it properly at all. Thoughts? – joseph_pindi Feb 06 '16 at 23:56
  • Here's the thing: I ran `code`find / -name "java" `code` and it is still looking but it doesn't look like it is finding 1.8. It tracks down 1.6 (even though I thought I uninstalled it) at /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java – joseph_pindi Feb 07 '16 at 01:38
  • So I'm thinking that the 1.8 isn't getting installed for some reason. Maybe I need to do it through Terminal or something instead of the installer? – joseph_pindi Feb 07 '16 at 01:39
  • I installed Java by going through here [https://www.java.com/en/download/] and downloading ire-8u73-macosx-x64.dmg – joseph_pindi Feb 07 '16 at 02:36
2

Echoing the answer, above, a full install of the JDK (8u121 at this writing) from here - http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html - did the trick. Updating via the Mac OS Control Panel did not update the profile variable. Installing via the full installer, did. Then Eclipse was happy.

todclifton
  • 31
  • 2
1

Here are steps:

  • download 1.8 JDK from this site
  • install it
  • copy the jre folder & paste it in "C:\Program Files (x86)\EclipseNeon\"
  • rename the folder to "jre"
  • start the eclipse again

It should work.

Alex M
  • 2,756
  • 7
  • 29
  • 35
suyog shinde
  • 111
  • 1
  • 2
1

For some weird reason "Java SE Development Kit 8u151" gives this trouble. Just install, "Java SE Development Kit 8u152" from the following link-

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

It should work then.

Natasha
  • 6,651
  • 3
  • 36
  • 58