I have installed the JDK on Mac OS X v10.8 (Mountain Lion). When I upgraded it to Mac OS X v10.9 (Mavericks) and ran java -version
I downloaded and installed the JDK 1.7 from Oracle. In the console / in Terminal Java 7 works fine.
When I start a Java program (like Eclipse) via the GUI, I get:
To open "Eclipse.app" you need a Java SE 6 runtime. Would you like to install one now?
Because I did not want to install old Java version, I used the following workaround:
sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
Credits to monkehWorks.