OpenJDK is the reference implementation of any JDK Enhancement Proposals (JEPs) or even Java Specification Requests (JSRs). You might have many reasons why you want to build it from sources and don't download one of the pre-built binaries, e.g.:
- company policy that enforces you to build open source projects from source
- you wish to get access to the latest early access OpenJDK
- you want a build for your special platform
You can download latest OpenJDK 9 binaries from this page. Sources can be found in the Mercurial repositories. E.g. OpenJDK 9 repos are here; project Jigsaw repo contains the hitting edge of the modular implementation, if you wish to be in the hitting edge. Below, you get some tips on how to build OpenJDK 9.
- Clone the JDK 9 Master mercurial repository.
- Read the README or README-builds.html file for more instructions.
- Next step before you start building is to execute: bash get_source.sh or ./get_source.sh if your shell is already bash. It is very important, after each update to call this command. The reason is that hg update only updates the master repository. OpenJDK consists of a number of mercurial repositories which need to be updated, too. This can be done by the get_source.sh command.
- ./configure --disable-warnings-as-errors
- sudo make all
- hg up
[tag] e.g. jdk-9+147 - cd corba
- hg up
[tag] e.g. jdk-9+147 - Repeat steps 2 & 3 for directories: hotspot, jaxp, jaxws, jdk, langtools, nashorn
- ./configure --disable-warnings-as-errors
- sudo make clean
- sudo make all
Best luck for your OpenJDK builds.