java 7 does not work with eclipse 3.6 or open office

Main menu:

Topics

Recent Posts

Blog

July 2012
M T W T F S S
« Jun   Aug »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Past Posts

Java/Java EE

JDBC

Other

java 7 does not work with eclipse 3.6 or open office

July 1st, 2012 by Jeanne Boyarsky

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.

Comments

Pingback from eclipse juno (4.2) review | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
Posted: July 1, 2012 at 8:17 pm

[...] java 7 does not work with eclipse 3.6 or open office [...]

Comment from Jeanne Boyarsky
Posted: July 2, 2012 at 8:37 pm

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 from java 7 on mountain lion | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
Posted: August 19, 2012 at 12:46 pm

[...]  I spent a good while getting Java 7 installed on Lion.  And now I get to do it again?  Luckily it wasn’t that [...]

Comment from Graham Perrin
Posted: August 20, 2012 at 11:02 am

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.

https://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=8496

Comment from Graham Perrin
Posted: August 20, 2012 at 11:14 am

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

Comment from Jeanne Boyarsky
Posted: August 20, 2012 at 7:31 pm

Updated the link. Thanks Graham!

Write a comment