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?
blog comments powered by Disqus