java 7 does not work with eclipse 3.6 or open office

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.

  1. 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.
  2. Click on dmg.  Double click to get Java wizard
  3. Open finder.  In the go menu choose utilities
  4. Choose java preferences and uncheck Java 1.6 or previous versions of 1.7 you have downloaded.
  5. 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).

 Open Office problem
Error: OpenOffice.org requires a Java runtime environment (JRE) to perform this task. The selected JRE is defective. Please select another version or install a new JRE and select it under Tools – Options – OpenOffice.org – Java.
Oh fun.  OpenOffice doesn’t yet play well with Java 7.  I wound up switching my system JRE back to 6 and my default Eclipse JRE to Java 7.  This makes everyone happy.

6 thoughts on “java 7 does not work with eclipse 3.6 or open office

  1. Pingback: eclipse juno (4.2) review | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky

  2. 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.

  3. Pingback: java 7 on mountain lion | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky

Leave a Reply

Your email address will not be published. Required fields are marked *