Posted on April 14, 2014

Building openJDK8 by myself

So, here’s what you do:


I’m not sure on all the dependencies but I think these at least are needed.

    apt-get update
    apt-get install mercurial zip bzip2 unzip tar curl ccache make gcc g++ ca-certificates ca-certificates-java libX11-dev libxext-dev libxrender-dev libxtst-dev libasound2-dev libcups2-dev build-essential
    hg clone
    cd jdk8
    bash configure
    unset CLASSPATH
    unset JAVA_HOME

bash configure will print out some nice stats:

    A new configuration has been successfully created in
    using default settings.
    Configuration summary:
    * Debug level:    release
    * JDK variant:    normal
    * JVM variants:   server
    * OpenJDK target: OS: linux, CPU architecture: x86, address length: 64
    Tools summary:
    * Boot JDK:       java version "1.7.0_51" OpenJDK Runtime Environment (IcedTea 2.4.6) (7u51-2.4.6-1) OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)  (at /usr/lib/jvm/java-7-openjdk-amd64)
    * C Compiler:     gcc-4.8 (Debian 4.8.2-16) version 4.8.2 (at /usr/bin/gcc-4.8)
    * C++ Compiler:   g++-4.8 (Debian 4.8.2-16) version 4.8.2 (at /usr/bin/g++-4.8)
    Build performance summary:
    * Cores to use:   10
    * Memory limit:   32158 MB
    * ccache status:  installed and in use

Actual build

    make all

Make all will take some time, 8 minutes on my machine, ymmv.

    ----- Build times -------
    Start 2014-04-14 22:25:52
    End   2014-04-14 22:33:55
    00:00:14 corba
    00:00:08 demos
    00:01:05 docs
    00:03:49 hotspot
    00:00:10 images
    00:00:11 jaxp
    00:00:15 jaxws
    00:01:37 jdk
    00:00:24 langtools
    00:00:09 nashorn
    00:08:03 TOTAL


    cd build/linux-x86_64-normal-server-release/jdk/bin
    ./javac -version
    javac 1.8.0-internal