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:
You need to create a file ~/.MacOSX/environment.plist
and add JAVA_HOME => /Library/Java/Home
entry into it.
If you have XCode installed, use it to add entry.
Otherwise, use plain text editor:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>JAVA_HOME</key>
<string>/Library/Java/Home</string>
</dict>
</plist>
After that, restart MaxOS or logout/login.
See http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html for details.
Cheers, Max