In preparation for downloading Eclipse 4.2 (Juno), I downloaded Java 7 for the Mac. It was quite an experience.
TL/DR: Don’t use Java 7 with Eclipse 3.6 or Open Office 3. Alternatives below.
Installed Java 7 for the Mac
Up to now, I’ve been doing all my Java 7 learning/testing/etc in a Linux JVM. Now that Juno is out, it seemed high time to add it to my path.
- Download the dmg from jdk7.java.net or Oracle’s main site. (both are now Oracle versions. The former is a slightly later version since it is a release preview. Oddly enough installing the Oracle one uninstalled the newer preview version of the jdk7 one.
- Click on dmg. Double click to get Java wizard
- Open finder. In the go menu choose utilities
- Choose java preferences and uncheck Java 1.6 or previous versions of 1.7 you have downloaded.
- Now “java -version” at the command line is Java 7.
Dr Dobbs describes this well with screenshots although they do assume you know how to open the java preferences.
Eclipse problem
Error: “failed to create the Java virtual machine”
However, when I tried to launch Eclipse 3.6, I got “failed to create the Java virtual machine.”
The first thing I did was check my path still contained the JDK:
javac -version
javac 1.7.0_05
I then tried the Eclipse alias that runs at a command line which got more of an error message:
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse ; exit; JavaVM: requested Java version ((null)) not available. Using Java at "" instead. JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib JavaVM FATAL: Failed to load the jvm library. logout
This problem is discussed in a stackoverflow thread. Juno does fix this problem.
Summary: Stay on Java 6 with Eclipse 3.7 (Indigo) and go to Java 7 with Eclipse 4.2 (Juno).