Build the OpenJDK from the sources

In this tutorial we build OpenJDK version 12 for MacOSX.

Install Mercurial

https://www.mercurial-scm.org/wiki/Download

Install brew : https://brew.sh

brew install mercurial

You can test that everything is working with

hg --version

Clone the repository

Example for Java 12:

hg clone http://hg.openjdk.java.net/jdk/jdk12

… it will take a while …

Here you can find the list of the available repositories:

http://hg.openjdk.java.net/jdk

When cloned, enter in the directory with the sources

cd jdk12

Verify that all the requirements are satisfied:

bash configure

Build the OpenJDK with

make images

At the end your image should be ready in the build folder, you can verify the version with:

./build/*/images/jdk/bin/java -version

e.g.

openjdk version "12-internal" 2019-03-19
OpenJDK Runtime Environment (build 12-internal+0-adhoc.marco.jdk12)
OpenJDK 64-Bit Server VM (build 12-internal+0-adhoc.marco.jdk12, mixed mode, sharing)

Enjoy it and contribute! ;-)

Bug Dashboard

How to contribute

Build, detailed instructions

Unofficial GitHub Repo

JDK 12 Tags

JDK 12 Log