Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse on Mac 10.8 - Installed 1.7.0 JRE / JDK, but Eclipse won't launch

  • Installed Java SE 1.7.0u10 from Oracle w/ their installer package

  • Downloaded and unpacked Eclipse Juno (4.2.1)

  • Double click Eclipse purple icon and get OS X alert prompt with error message:

To open "Eclipse," you need a Java SE 6 runtime. Would you like to install one now?

  • (in terminal) which java - /usr/bin/java

  • ls -l /usr/bin/java - /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

  • (in Finder) Double click eclipse alias (included when unpacked download) - Terminal launches, /Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse ; exit ; and Exclipse launches without OS X alert prompt.

I've tried modifying the Eclipse app bundle plist to point the -vm key to /System/Library/Frameworks/JavaVM.frameworks/Versions/Current/Commands/java, but I feel like I probably shouldn't have to do this.`

I'd like to know how to get Eclipse to launch by just double clicking on the Application package. It's such a small thing to bug me... :o)

like image 972
edelaney05 Avatar asked Dec 31 '12 19:12

edelaney05


People also ask

Does Eclipse use JRE or JDK?

Eclipse is an IDE that runs on a java VM. It only requires a jre.

Do we need both JDK and JRE for Eclipse?

Eclipse is a Java-based application and, as such, requires a Java Runtime Environment or Java Development Kit (JRE or JDK) in order to run. Note that on recent versions of Mac, a full JDK needs to be installed, not just a JRE; see instructions below.


2 Answers

The best answer is to fix the Java 7 installation as shown here : https://stackoverflow.com/a/19594116
Simple to do and I have confirmed it works on Mavericks. With this fix, you can launch your app from the launchpad as usual. If you upgrade your JDK, you will have to reapply the fix to the new installation.

like image 151
Sunil Avatar answered Oct 16 '22 08:10

Sunil


I had JDK 7 installed and I solved this issue for eclipse Kepler by running eclipse from the terminal instead of the finder.

./eclipse

Just thought to share.

Update 1

For the sake of completeness, if you want to run it from Finder as well, you can wrap the ./eclipse command into a .command file and run it from Finder (so that you don't have to open a terminal)

The following lines should do the job (don't forget to replace "your-full-eclipse-path" with the eclipse path on your machine)

#!/bin/sh
/your-full-eclipse-path/eclipse

After that, give execute permission to the eclipse.command file you just created

chmod +x eclipse.command
like image 9
Hisham Avatar answered Oct 16 '22 08:10

Hisham