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.
- Download the binaries.
- 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
- 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
- Check out the code.
- Change permissions on get_source.sh
- 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:
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.
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
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.
Build openjdk like this: