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:
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).