Skip to content

How to build and package OpenJDK 7 on Linux

hgomez edited this page Nov 9, 2012 · 35 revisions

Some pre-requisites are required to build OpenJDK7 on Linux

Build and package pre-requisites

openSUSE / SLES

sudo zypper install git-core mercurial zip bzip2 unzip tar 
sudo zypper install ccache make gcc gcc-c++ ca-certificates-cacert ca-certificates-mozilla
sudo zypper install libstdc++-devel alsa-devel cups-devel xorg-x11-devel libjpeg62-devel giflib-devel 
sudo zypper install rpm gpg

CentOS 5/6

sudo yum install git-core mercurial zip bzip2 unzip tar 
sudo yum install ccache make gcc gcc-c++ libstdc++-devel 
sudo yum install alsa-lib-devel cups-devel libX11-devel libXext-devel libXt-devel libXrender-devel libXtst-devel libXi-devel libjpeg-devel giflib-devel freetype-devel
sudo yum install rpm-build gpg

Fedora 16/17

sudo yum install git-core mercurial zip bzip2 unzip tar 
sudo yum install ccache make gcc gcc-c++ 
sudo yum install libstdc++-devel libstdc++-static alsa-lib-devel cups-devel libX11-devel libXext-devel libXt-devel libXrender-devel libXtst-devel libXi-devel libjpeg-devel giflib-devel freetype-devel 
sudo yum install rpm-build gpg rpmbuild rpm-sign

Prepare environment

For example, you want to build OpenJDKs in openjdkathome directory under your home directory.

mkdir ~/openjdkathome
cd ~/openjdkathome
git clone https://github.com/hgomez/obuildfactory.git

Building OpenJDK

Building is activated by XBUILD env var set to true

cd ~/openjdkathome
XBUILD=true ./obuildfactory/openjdk7/linux/standalone-job.sh

After some minutes you should see this logs :

#-- Build times ----------
Target all_product_build
Start 2012-10-25 22:10:11
End   2012-10-25 22:15:42
00:00:15 corba
00:00:06 hotspot
00:00:04 jaxp
00:00:07 jaxws
00:04:52 jdk
00:00:06 langtools
00:05:31 TOTAL
-------------------------
openjdk version "1.7.0-u10-b09"
OpenJDK Runtime Environment (build 1.7.0-u10-b09-20121025)
OpenJDK 64-Bit Server VM (build 23.6-b03, mixed mode)
openjdk version "1.7.0-u10-b09"
OpenJDK Runtime Environment (build 1.7.0-u10-b09-20121025)
OpenJDK 64-Bit Server VM (build 23.6-b03, mixed mode)

You'll find JDK/JRE tarballs under OBF_DROP_DIR/openjdk7

ls -l OBF_DROP_DIR/openjdk7

Images tarballs