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.
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:
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).
Pingback: eclipse juno (4.2) review | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
Some comments i got offline:
> Why not Eclipse 3.8
4.0 represents the new engine. I assume they fixed bugs/added features until it was time for the release train.
> Would be curious to know what the “maven” support is that is in the Java version m2eclipse.
> Curious what advantages you find in Sysdeo versus native Eclipse support for Tomcat.
Historical habit? It is simple and it works. Which means I haven’t tried native support in ages. I probably should.
> Curious why you prefer FreeMarker over Velocity.
I don’t like Freemarker better. I prefer JSTL over Freemarker. JForum (the forum JavaRanch/CodeRanch uses) has a Freemarker front end..
> I wonder if the Java 7 support in the IDE works without any need to install Java 7 independently of Eclipse, and if the Java 7 that comes with Eclipse is an Oracle version or some other brand.
No. Eclipse doesn’t come bundled with an IDE – at least not by default. It is using my standalone Java 7 JDK that I installed.
Pingback: java 7 on mountain lion | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
extensions to OpenOffice.org: workaround when ‘JRE is Defective’ appears
For me with NeoOffice, the work around was to disable extensions that are (presumably) not compatible with the latest Java.
Side note, the link to the Dr Dobb’s article should be http://www.drdobbs.com/jvm/java-7-preview-for-mac-os-x/231901234
Updated the link. Thanks Graham!