Skip to end of metadata
Go to start of metadata

Building the BSD port of OpenJDK, Java 1.7 on Max OS X 10.5.8

This content began its life at http://confluence.concord.org/display/CCTR/Build+OpenJDK+Java+1.7.0+on+Mac+OS+X+10.5, but should be annotated and extended as we learn more. See the BSD-Port mailing list for information.


The original OpenJDK build could be built using the SoyLatte 1.6 binaries from Landon Fuller. The project has matured to a point that the original bootstrap binary will not work. Kurt Miller produced a new set of PPC based binaries which can be used to bootstrap the build, or you can use a binary available from John Yeary. These new binaries are based on Shark and work in interpreted mode. 

OpenJDK 7 32-bit PPC

Please select a binary to use to boot strap your build. You can use openjdk7-zerovm-ppc-jyeary-2012-02-16-07-18-b00.zip or Kurt Miller's macppc builds.

  1. Download the binaries.
  2. Copy the binaries to /usr/local/XXX where the XXX represents the binary package like /usr/local/openjdk7-zerovm-ppc-jyeary-2012-02-16-07-18-b00
  3. Test the installation.


Assuming you have MacPorts installed:

Otherwise you can download and install the latest version of Mercurial and install it.

Test the mercurial install:

Create ~/.hgrc file. The example below is what my current file looks like.

Checkout OpenJDK Source Code

  1. Check out the code.
  2. Change permissions on get_source.sh
  3. Run get_source.sh This will fetch the additional code and any updates to the forest.

Once the process completes, you should have something similar to the listing below:

Build OpenJDK

The version below is adapted from Kurt Miller's script. Edit the path information to fit your directory structure.

After some period of time you should get a successful build print out like the one below:

Please check with the BSD-Port mailing list if you encounter problems.

Error Recovery

Try cleaning if you get errors.

Some errors when compiling are fixed by cleaning. You can temporarily add the clean command to the end of build.sh and source it to clean the build products.

X11 is needed for build.

If you have not installed this with Mac OS X, or have deleted it, you need to install it. A copy can be obtained from http://xquartz.macosforge.org/trac/wiki/X112.4.0.

Update the bsd-port directory

If updates have been made to the tree, perhaps to fix a bug, you can update your sources with:


If the build completes do a simple test by asking the JVM to print its version info. It should look something like this:

Then, see how to switch java versions on Mac OS X.


SoyLatte 32-bit Java 1.6 binaries

One can use Landon Fuller's SoyLatte 32-bit Java 1.6 binaries to build the OpenJDK bsd port. After downloading the binaries, copy the whole directory to /usr/local/soylatte16-i386-1.0.3

Test the SoyLatte install:

Forest extension to Mercurial

This is the canonical source for the Forest extension:

You can also use Patrick Mézard's clone of hgforest instead (just a couple of fixes to Simon's work):

After cloning hgforest-crew add an hgext.forest item with the path to hgforest-crew/forest.py in the extensions section in your ~/.hgrc file.

JiBX v1.1.5

The JiBX library (Binding XML to Java Code) is a prerequisite for building. Install v1.1.5 of the JiBX: Binding XML to Java Code: downloads.

Build OpenJDK

Build openjdk like this:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.

The individuals who post here are part of the extended Oracle community and they might not be employed or in any way formally affiliated with Oracle. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Oracle nor any other party necessarily agrees with them.