This is so frustrating.
I did no update of java nor eclipse and suddenly I can\'t open eclipse. I even didn\'t install any other programs. Here is the error:
OK, after a few days of struggling and with no luck on this thread and Eclipse forums THREAD I started a bounty for this question and had no correct answer.
I found a solution to this problem (this stack).
ANSWER:
You need to edit the Eclipse.app/Contents/Info.plist file and add two lines in it:
Nowhere stated that this lines had to go in Eclipse array but just somewhere up as key-string.
If you don't have Xcode, edit that file with textedit:
<key>Eclipse</key>
<array>
<string>-vm</string>
<string>/System/Library/Frameworks/JavaVM.framework/Home/bin/java</string>
<string>-keyring</string>
<string>~/.eclipse_keyring</string>
<string>-showlocation</string>
</array>
try to add this to your ~/.profile
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/
export PATH=$JAVA_HOME/bin:$PATH
Try moving your workspace and deleting the configs (rm -rf ~/.eclipse
). Sometimes Eclipse messes up its env and needs to be reset.
I've fixed this using a 2 step solution:
*1. Set JAVA_HOME correctly:*
Find out the Java JDK location:
/usr/libexec/java_home
Create the ~/.bash_profile if needed:
touch ~/.bash_profile
Edit the .bash_profile file using TextEdit, and add the following lines (change the paths as necessary):
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/ export PATH=$JAVA_HOME/bin:$PATH
2. Set the alias to be executable:
From the eclipse install location, run:
chmod +x ./eclipse
Now to activate Eclipse I open Finder, navigate the to eclipse installation directory and double click the alias file (named eclipse, but without the eclipse icon).
Editing the plist file is not the recommended way of setting the JVM. See http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#Find_the_JVM and it points you to http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM
Basically inside Eclipse.app/MacOS/eclipse.ini is where you'll want to specify command line arguments that get passed to eclipse by default. Granted the plist's array of arguments are also used, but that isn't how the Eclipse docs themselves recommend setting arguments (and it is possible that as a result, it might get wiped when you update Eclipse again).
You'd want to remove the vm entry from that Array in the plist and instead add the following in the eclipse.ini before "-vmargs":
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
I've encountered the same issue but a simple
chmod +x Contents/MacOS/eclipse
in the package content, did the trick.