Java

We would like to build OpenJDK 8 from scratch using Baserock. One of the problems this gives is that building OpenJDK requires a functional JDK to start with, i.e. cannot be bootstrapped without the Oracle commercial JDK.

You'll need some prerequisite software - on a Debian-based system, sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libfreetype6-dev libmotif-dev libcups2-dev should get most of them.

As long as you've got a version 7 JDK, building is pretty straightforward. The instructions for baserock below should also work on a Debian-based system if you've got the packages listed above.

In Baserock

At the time of writing, the zookeeper stratum uses a Java 8 SDK binary, which is stored as a binary inside a git repository.

There is a patch series in flight which adds zip, symlinks javac from that SDK binary, and contains a dependency on x-common so we get some of the x libraries. With this patch, if you add the java-build stratum to your development system, you will have better support for building OpenJDK 8. You will be able to follow the steps above as far as 'bash ./configure', at which point it will fail due to not being able to find certain X11 headers.

Testing the java-build system

Once you have built and deployed a java-build system, you should be able to build a new copy of the JDK using these instructions in your deployed system:

cd /src
hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8
cd openjdk8
sh ./get_source.sh
bash ./configure --with-boot-jdk=/usr/lib/java-8-openjdk
make all

Apart from requiring an existing JDK, the 'get_source.sh' script also pulls software from other sources, which we'd be better off lorrying. However, they do all appear to come from mercurial repositories, so this should be straightforward.

Jikes and GCJ

It is possible to build simple programs using either jikes or GCJ, but neither of these ship with a JDK more modern than 1.5.0. It isn't possible to build JDK6 with any version of the JDK less than 1.6 (JDK6 is version 1.6, roughly speaking) so neither of these appear to give us any opportunity to build a JDK purely from source.

IcedTea

IcedTea does look like a promising way to build OpenJDK without needing a binary JDK to bootstrap it. We have reproduced this process on a Debian system; encoding it into Baserock definitions may follow later.