Tuesday, January 19, 2010

Eclipse 3.6 on OpenJDK on Mac OS X

Eclipse 3.6 (aka Helios) will run on OpenJDK on Mac when it's released this year. This will free us from Apple's oft-criticized and historically slow release cycle of the Java VM.

With a little persistence and help from some committers at Eclipse, the most glaring problems were resolved:

  • bug 276564:Eclipse won't launch using JDK 7 because SWT native libraries don't load
  • bug 276763: [launcher] launcher fails to use OpenJDK-based VM when -vm is specified

If you're interested in trying it out, you'll need to get an integration build of Eclipse (see 3.6 Stream Integration Builds) I20100119-0800 or newer, or a nighly build N20100117-2000 or newer. Prior to these builds, running Ecilpse on OpenJDK on a mac was only possible with some trickery. You'll also need a working OpenJDK on your mac, which can be built from source using these instructions, or installed using mac ports.

Many thanks to the Eclipse team for helping, notably Andrew Niefer, Mike Wilson, Kevin Barnes, Grant Gayed, Felipe Heidrich, Thomas Watson, Steve Northover and Silenio Quarti.


Chris Aniszczyk (zx) said...

Thanks for pushing on this David!

Anonymous said...

Hi, I'm just about to play with OpenJDK source codes on Mac. Last time I use Eclipse (on Linux), I find out it only works with a final build image of JDK, that it to say, it only looks for class files from rt.jar etc. However, since building an image costs quite some time, my JDK is normally in "developing" form, with class files in the jdk/classes directory. Is there any chance that Eclipse can work with this kind of JDK? I would be even happier if the IDE can recognize any class file changes dynamically.

David Green said...

@Anonymous I recommend that you try it out. If it doesn't work, consider filing a bug or asking on the newsgroups.

Miles Parker said...

Very cool David...it's obviously not a problem with Eclipse thankfully, but OS X AWT graphics sucks so unbelievably badly OOTB -- my favorite rant.

So the obvious question is -- what's the general performance like vis. Apple's Java 6?

David Green said...

@Miles Parker I haven't noticed any differences in performance, however without measuring in a controlled environment it's anyone's guess.

The main benefit of using OpenJDK is that a) you can run a 32-bit VM on Leopard, and b) you can run any version of Java that you want instead of having to wait for Apple to release it.

Axel Rauschmayer said...

This is great news indeed.

Note that Java 6 on Snow Leopard is 32bit (on 32bit machines).

Could you maybe post a screen shot? I would like to see what it looks like. I assume it runs on X11(?)

David Green said...

@Axel Rauschmayer since SWT uses native widgets it does not run on X11, it uses the mac native controls (Cocoa in this case). As far as a screenshot, it looks the same as when run using the Apple VM.