Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Eclipse Indigo on JDK 1.7 OSX

Tags:

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.  
like image 720
Olivier Refalo Avatar asked Oct 06 '11 02:10

Olivier Refalo


People also ask

Do we need to install JDK for Eclipse?

Current releases of Eclipse require Java 11 JRE/JDK or newer. A Java Development Kit (JDK) includes many useful extras for Java developers including the source code for the standard Java libraries. Regardless of your operating system, you will need to install some Java virtual machine (JVM).

What version of Eclipse works with Java 8?

Java 8 is available as an update for Eclipse Kepler (2013 Release) and is now available nightly / integration builds towards Eclipse Luna (2014 Release).

Does Eclipse support Java 17?

Java 17 is out and Eclipse JDT supports Java 17 in 4.21 via Marketplace. The release notably includes the following Java 17 features: JEP 306: Restore Always-Strict Floating-Point Semantics.


1 Answers

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.

like image 58
Mary Hamlin Avatar answered Sep 16 '22 14:09

Mary Hamlin