NOTE $SOURCE_CODE is where you are installing the source code to. If you are using the AdoptOpenJDKVMBuild then this is /home/openjdk/sources. If you are using YourOwnEnvironment then it's likely to be something like /home/<your username>/sources
OpenJDK uses Mercurial as its source control system. Mercurial is DVCS, similar to git. If you aren't familiar with Mercurial, you should download this free book which has good Mercurial coverage.
The command for Mercurial is hg - because Hg is the chemical symbol for Mercury.
NOTE: OpenJDK used to use the 'forest' extension - which required specific versions of Mercurial and was somewhat of a pain to work with. Recent builds do not require forest - and it is no longer maintained, so do not use forest with OpenJDK - and remove all reference to it from your ~/.hgrc file.
This works for:
Open a Terminal, you'll execute the following steps:
Note: the last letter in jdk8_tl is the small letter 'l' and not the digit 1 - and applicable to all references to this term throughout the wiki.
The commands are as follows:
mkdir $SOURCE_CODE ; cd $SOURCE_CODE ; sudo apt-get install git-core ; sudo apt-get install mercurial ; hg clone http://hg.openjdk.java.net/jdk8/tl jdk8_tl ; cd jdk8_tl/ ; chmod u+x get_source.sh ; ./get_source.sh ;
In order to retrieve sources from the OpenJDK mercurial repo, please perform the below installations first.
In addition to packages selected by default, also select the following packages (there is a search field at the top):
Note: Do not add C:\cygwin\bin to your system path.
The following command should select all needed packages:
setup.exe -R C:\cygwin -P binutils,cchache,cpio,file,gawk,gcc,gcc-core,make,m4,procps,unzip,vim,zip (Note: this stopped working starting a certain version of Cygwin - if the command-line action does not work, you will have to select the packages manually).
This is your future shell where al the OpenJDK building happens.
From http://tortoisehg.bitbucket.org/download/, Filename: tortoisehg-2.5.1-hg-2.3.2-x64.msi.
This is needed to actually clone the OpenJDK mercurial repositories.
Start a cygwin shell using the desktop icon
$ cd /cygdrive/c $ mkdir OpenJDK $ cd OpenJDK $ mkdir jdk8_tl $ hg clone http://hg.openjdk.java.net/jdk8/tl jdk8_tl $ cd jdk8_tl $ bash get_source.sh
From the Mac Terminal application
Ensure $SOURCE_CODE is set - see beginning of the page. cd ~ mkdir $SOURCE_CODE cd $SOURCE_CODE
Go to http://git-scm.com/download/mac Download the Git…dmg file, and open it. Double click on the git…dpkg file in the folder. Git installation starts. [Optional] Copy the setup git PATH for non-terminal programs.sh from within the folder to outside the folder i.e. Git folder and run it from the terminal prompt.
Go to the Mac section at http://mercurial.selenic.com/downloads/ Download the .zip file that corresponds to your version of the Mac OS. Unzip the zip file, and double click on the .pkg file to start the installer.
(On a Mac it's probably better to use the binary installers for git & mercurial.)
Now download the source and prepare for build:
hg clone http://hg.openjdk.java.net/jdk8/tl jdk8_tl ; cd jdk8_tl/ ; chmod u+x get_source.sh ; ./get_source.sh ;