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)
Hoping you are using 64-bit of Java SE 1.7.0 and so advising the following.
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
into JRE homeYou would need a restart.
open
/Library/Java/JavaVirtualMachines/jdkXXXXX.jdk/Contents/Info.plist
settting(
<string>BundledApp</string>
is usefull!):For what it's worth, the Eclipse team seems to have worked around it by replacing their dlopen()-based method with a CFBundleCreate()-based one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361
In case anybody has the same problem in their code that launches Java and does not want to resort to Apple-only APIs, I found an easier work-around: before dlopen()ing $JRE_HOME/lib/server/libjvm.dylib, make sure to open dlopen() $JRE_HOME/lib/jli/libjli.dylib. Then it won't ask to install Java 6.
Can you imagine that? You have to install a JDK 1.6 to get eclipse ran properly, even if you already have jdk 1.7 installed, and set the JAVA_HOME properly.
To resolve your issue, you just need to download the jdk1.6 from http://support.apple.com/kb/DL1572?viewlocale=en_US, and install it, later you will be able to run eclipse, and you can set the JAVA_HOME to JDK1.7, and you will be able to find the JDK1.7 from eclipse "Preferences".
I had the exact same message when setting up a new mac and trying to run eclipse 4.2.2 with only Java SE 7 installed (as part of JDK 7u17).
In order to be able to successfully launch Eclipse I had to let OSX download and install Apple's Java SE 6 runtime first before installing the latest JDK.
After installing the JDK, the command
java -version
correctly shows:Trying to solve the problem the other way around didn't work -- i.e. installing JDK 7u17 first before installing Java SE 6 as suggested in the message.
I had the exactly same problem some days ago and I solved it today. Just installed this http://support.apple.com/kb/dl1572
And after that, when I opened the eclipse the OSX installed some java update and opening eclipse by Eclipse.app started working.
Hope it works with you too.