Building OpenJDK 1.7.0 for Mac OS X 10.6 (Snow Leopard)

I’m basing this blog entry on this reference page.  There are only a few different things that you need to do so I will spell those out cleanly relative to what was previously needed:

  1. Grab the dependencies except for JIBX, it is no longer needed for the build.
  2. Checkout the code as described.
  3. export JAVA_HOME=$SOYLATTE_HOME
  4. The build script is somewhat different:
env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin \
 make \
 CC=gcc-4.0 CXX=g++-4.0 \
 ALT_BOOTDIR=$SOYLATTE_HOME \
 JAVA_TOOLS_DIR=$SOYLATTE_HOME/bin \
 ALT_FREETYPE_HEADERS_PATH=/usr/X11R6/include \
 ALT_FREETYPE_LIB_PATH=/usr/X11R6/lib \
 ANT_HOME=/usr/share/ant \
 NO_DOCS=true \
 HOTSPOT_BUILD_JOBS=1

That should then result in a build/bsd-i586/j2sdk-image directory containing the JDK.

This entry was posted in Technology. Bookmark the permalink.
  • alex

    Hey thanks for the build script. This worked great for me =) (Although… more than 30 minutes on my Macbook 1G)

    But I have an error when starting the vm:

    alex$ ./java -version
    Error occurred during initialization of VM
    Unable to load native library: dlopen(/usr/local/java-1.7.0-internal-2010_01_03/jre/lib/i386/libjava.dylib, 1): Library not loaded: libjvm.dylib
    Referenced from: /usr/local/java-1.7.0-internal-2010_01_03/jre/lib/i386/libjava.dylib
    Reason: image not found

    Can you maybe give me a hint?

  • http://alexoto.wordpress.com/2010/03/04/java-1-7-auf-mac-os-x-10-6-snow-leopard/ Java 1.7 auf Mac OS X 10.6 – Snow Leopard « Alex Online Today

    [...] für den Artikel ist ein Beitrag von Sam Pullara und ein etwas älterer von Stephen Bannasch und einige Mails von der BSD Port Development [...]

  • http://alexander-wolf.net/blog/?p=68 Java 1.7 auf Mac OS X 10.6 – Snow Leopard | Alex Online Today

    [...] für den Artikel ist ein Beitrag von Sam Pullara und ein etwas älterer von Stephen Bannasch und einige Mails von der BSD Port Development [...]

  • Henri Gomez

    It works now (November 2010) when calling with full java bin path, ie /usr/local/java-1.7.0-internal-2010_01_03/bin/java

    But still fail if you define JAVA_HOME and use /usr/bin/java

    see http://code.google.com/p/openjdk-osx-build/issues/detail?id=4

blog comments powered by Disqus