Παρασκευή, 13 Ιανουαρίου 2017

OpenJDK How to Build

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.
  1. Clone the JDK 9 Master mercurial repository. 
  2. Read the README or README-builds.html file for more instructions.
  3. 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.
  4. ./configure --disable-warnings-as-errors
  5. sudo make all
The above commands build the latest version of OpenJDK. If you wish to build an earlier version of OpenJDK you need to follow these tips:
  1. hg up [tag]  e.g. jdk-9+147
  2. cd corba
  3. hg up [tag]  e.g. jdk-9+147
  4. Repeat steps 2 & 3 for directories: hotspot, jaxp, jaxws, jdk, langtools, nashorn 
  5. ./configure --disable-warnings-as-errors
  6. sudo make clean
  7. sudo make all
Best luck for your OpenJDK builds.

Δεν υπάρχουν σχόλια: