At the time of writing, the OpenJDK 9 project was still quite similar to OpenJDK 8. So most of the information about building OpenJDK 9 can be found in Chapter 4, Building OpenJDK 8.
One point that differentiates OpenJDK 9 from OpenJDK 8 is the usage of the Clang compiler on Mac OS X. Starting with Xcode Version 5, Clang became the official compiler on Mac OS X instead of GCC. There were plans to use it as an official compiler for OpenJDK 8 on Mac OS X but that switch was postponed to OpenJDK 9.
In this recipe, we will build the current codebase of OpenJDK 9 using Xcode 5 and the Clang compiler.
For this recipe, we will need a clean Mac OS X 10.8 Mountain Lion or 10.9 Mavericks running with Mercurial source control tools installed.
The following procedure will help us to build OpenJDK 9:
Download Xcode 5 from https://developer.apple.com/xcode/ (an Apple developer's account is required, registration is free) and install it...