22

With the recently OSX JDK 7 ea release from Oracle. How to run Eclipse Indigo ?

I get the following error msg:

$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home
$ java -version
openjdk version "1.7.0-ea"
OpenJDK Runtime Environment (build 1.7.0-ea-b211)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)
$ /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse
JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library. 
Olivier Refalo
  • 50,287
  • 22
  • 91
  • 122

3 Answers3

60

I just tried this myself and had some complications so I thought I would share what ended up working for me:

  1. Download and install Mac OSX version of Java SE Development Kit 7
  2. Under Eclipse -> Preferences -> Java -> Installed JREs, click Add, select Mac OS X VM, then click Next.
  3. Enter "/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home" as the JRE home directory, enter something reasonable like "Java SE 7" as the JRE name, and then click Finish. (Note that you won't be able to navigate to the "../Contents/Home" folder. You will have to type it in manually.)
  4. After adding the new JRE to the list of Eclipse installed JREs, check the box next to the new JRE that you just added and then click OK.
  5. Now under Eclipse -> Preferences -> Java -> Compiler, select 1.7 from the "Compiler compliance level" dropdown and click Ok.

Hope this helps someone who has problems figuring this out. The confusing part for me was selecting the JRE home directory in Eclipse, since I wasn't able to navigate to it.

Mary Hamlin
  • 4,137
  • 2
  • 26
  • 19
  • I experienced the same issue and your proposal was the appropriate solution. Thanks ! – jbmusso Jun 20 '12 at 11:55
  • Making copy&paste of "/Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home" in the "JRE home" field didn't worked for me...I had to create an alias of the home directory and access this alias from /Library/Java/ in the "open" windows – Hamal000 Oct 02 '12 at 12:01
  • 1
    @MaryHamlin Doesn't this just mean that compilation etc is under Java 7 but eclipse )Indigo) still runs under Java 6? – mmmmmm Mar 27 '13 at 13:05
  • I'm not really an Eclipse/Java expert, and I haven't used Eclipse in a while, so I don't know if I could give you a definitive answer on that. But apparently the 3.7.1 service release of Indigo formally added support for Java 7. Here is a link to an article introducing the release: http://www.infoq.com/news/2011/09/eclipse-indigo-371. Clicking on the "what's new with Java 7" link lists a number of Java-7 specific features introduced into the IDE, so you might want to install that service release if you haven't done so already and see if it gives you more support for Java 7. – Mary Hamlin Mar 27 '13 at 16:25
  • eclipse kepler has NO eclipse -> Preferences -> Java -> Installed JREs – sundowner Aug 07 '13 at 01:11
  • @sundowner, I haven't used Eclipse in a while, but the issue that I was having was with the Indigo version (pre 3.7.1). As I said in my previous comment, I think that Java 7 support is now baked into newer releases of Eclipse, like the Kepler version that you are referring to. – Mary Hamlin Aug 08 '13 at 13:26
  • Works for Eclipse Juno as well. Thanks. – Irwin Aug 08 '13 at 18:46
  • I found my problem: I had installed eclipse for C/C++, which does not include the Java Developer Tools. I added that, and now everything works, and the JRE1.7 is chosen as the default. – sundowner Aug 09 '13 at 14:48
  • This should have a prerequisite that you have already been able to launch Eclipse! In my case, I'm sure I'm not the only one, I'm not able to launch Eclipse to begin with – ericn Aug 17 '14 at 05:58
1

The Eclipse bug is resolve in the last Eclipse 3.8 Milestone.

It's work for me.

igor
  • 11
  • 1
1

Try this: http://twitter.com/#!/cimnine/status/126219234203271168/photo/1

Worked for me.

This is an old solution and has no relevance anymore.

cimnine
  • 3,987
  • 4
  • 33
  • 49