Eclipse in OS X uses different version of Java than CLI
eclipse, java, macos
Solution
Download the 64-bit version of Eclipse instead of the 32-bit version.
The reason is that Eclipse contains native machine code (for the GUI) which is why there is both a 32-bit and 64-bit version of Eclipse, and this explicitly require the corresponding Java version. Originally Apple created both versions up to Java 6, but Oracle only creates a 64-bit version (much to the dismay of owners of older machines). So, if you download a 32-bit version of Eclipse it will only run with an Apple JVM, which apparently is too old (which surprise me - I thought Java 6 was still supported for Eclipse 4.4)
Problem
When I type `java -version` in the console I get `java version "1.8.0_05"`. The soft link `/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK` points to `/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents`. In the java preferences window, the only listed version of Java is 1.8. JAVA_HOME is set to `/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home`. However, when I try to run Eclipse.app, I get the error: `Version 1.6.0_65 of the JVM is not suitable for this product. Version: 1.7 or greater required.` I believe it is trying to use `/System/Library/Java/JavaVirtualMachines` and in that directory the only version is `1.6.0.jdk`. How can I get eclipse to use the correct version of Java?