Eclipse 3.4 with openjdk 6 on OS X 32-bit CoreDuo

With the invaluable help of David Green, I was able to run Eclipse on openjdk 6 on my first gen MacBook Pro (you know, those left behind by Apple, running on a 32 bit CoreDuo processor… good to know that Apple supports the early adapters).

With this script that I adapted from David’s blog I was able to start Eclipse 3.4 (Version: 3.4.2
Build id: M20090211-1700) with Landon Fullers openjdk 6 build:

export JAVA_HOME=/Developer/Java/openjdk6-b16-24_apr_2009-r1
export PATH=$JAVA_HOME/bin:$PATH

java -server -Djava.library.path=$HOME/bin/jnilib -Dswt.library.path=$HOME/bin/jnilib -Xms128m -Xmx768m \
    -XX:MaxPermSize=192m -Dosgi.requiredJavaVersion=1.5 -Dorg.eclipse.swt.internal.carbon.smallFonts \
    -cp /Applications/eclipse/Eclipse.app/Contents/MacOS/../../../plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar \
    org.eclipse.equinox.launcher.Main -os macosx -ws carbon -arch x86 -showsplash \
    -launcher /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse -name Eclipse \
    --launcher.library /Applications/eclipse/Eclipse.app/Contents/MacOS/../../../plugins/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731 \
    -startup /Applications/eclipse/Eclipse.app/Contents/MacOS/../../../plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar \
    -launcher /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse \
    -keyring $HOME.eclipse_keyring -consoleLog -showlocation -vm $JAVA_HOME

The script misses the shebang, since my hosting provider thinks that I’m trying to execute some serverside exploit…
You’ll have to extract a couple of shared libraries that are packaged in your Eclipse distribution:

jar xfv /Applications/eclipse/plugins/org.eclipse.swt.carbon.macosx_3.4.1.v3452b.jar
jar xfv /Applications/eclipse/plugins/org.eclipse.core.filesystem.macosx_*.jar os/macosx/liblocalfile_1_0_0.jnilib

You’ll have to rename all those libraries to give them a *.dylib extension.

Finally I had to point /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home to the openjdk 6 directory:

sudo mv /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home.old
sudo ln -s LOCATION_OF_OPENJDK /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home

Tags: , ,

4 Responses to “Eclipse 3.4 with openjdk 6 on OS X 32-bit CoreDuo”

  1. I do get into troubles rather quickly, so this is not for the faint of heart… For example:

    #
    # An unexpected error has been detected by Java Runtime Environment:
    #
    # SIGSEGV (0xb) at pc=0×9240f336, pid=24654, tid=2953121792
    #
    # Java VM: OpenJDK Server VM (11.0-b17 mixed mode bsd-x86)
    # Problematic frame:
    # C [CoreGraphics+0x3d336] CGFontGetGlyphIdentifiers+0×8d
    #
    # An error report file with more information is saved as:
    # /Users/dashorst/bin/hs_err_pid24654.log
    #
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

  2. And this one came along two times already:

    2009-06-02 11:58:52.573 java[24801:113] An uncaught exception was raised
    2009-06-02 11:58:52.575 java[24801:113] objc_object* -[WebView initWithFrame:frameName:groupName:](WebView*, objc_selector*, NSRect, NSString*, NSString*) was called from a secondary thread
    2009-06-02 11:58:52.576 java[24801:113] *** Terminating app due to uncaught exception ‘WebKitThreadingException’, reason: ‘objc_object* -[WebView initWithFrame:frameName:groupName:](WebView*, objc_selector*, NSRect, NSString*, NSString*) was called from a secondary thread’
    2009-06-02 11:58:52.576 java[24801:113] Stack: (
    2480050347,
    2521951803,
    2480049803,
    2480049866,
    2488113267,
    2464832318,
    1462886474,
    30205098
    )

  3. As this happens when a code-completion box pops up, I’m reverting back to Java 5… darn… I really liked the idea of not living in 2005 anymore…

  4. MM says:

    Hi,

    I’ll be happy if I can get eclipse with the stock jdk but I keep getting
    The project cannot be built until build path errors are resolved
    Unknown Java Problem
    Unbound classpath container: ‘JRE System Library [OSGi/Minimum-1.2]‘ in project ‘t’ t Build path Build Path Problem

    ———
    I’m trying to run eclipse on my Core 2 Duo MacBook Pro:
    10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386

    Java:
    java version “1.6.0_15″
    Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
    Java HotSpot(TM) Client VM (build 14.1-b02-90, mixed mode)

    Eclipse:
    Version 3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7
    Build id: M20090917-0800

Leave a Reply