Skip to main content

Building Jigsaw

Last updated: 2013-07-27

In preparation for Devoxx 09, I wanted to play a little with Jigsaw.
Thereafter are the few steps I have followed to build it (based on the build readme for Jigsaw but revised each time I build Jigsaw):

1. Create a new Ubuntu VM in VirtualBox

To download VirtualBox go here
and to download Ubuntu (12.04 LTS or 13.04) go there.

I used 2Gb of RAM and 16 Gb of disk.
(don’t forget to install the guest additions and get the updates for Ubuntu)

2. Get and setup Mercurial

Open a console (Applications|Accessories|Terminal), type:

sudo apt-get install mercurial

3. Download and install the current build dependencies for OpenJDK7

sudo apt-get build-dep  openjdk-7

4. Download and install the current JDK7

sudo apt-get install openjdk-7-jdk

5. Download and install ccache

This will speed up the build of native parts

sudo apt-get install ccache

6. Get Jigsaw sources

mkdir ~/dev
cd ~/dev/
hg clone http://hg.openjdk.java.net/jigsaw/jigsaw/ jigsaw
cd ~/dev/jigsaw/
chmod u+x get_source.sh
./get_source.sh

7. Set up the environement variables

Source encoding:

export LANG=C

8. Adjustments

2013-07-27, none.

9. Configure

make sure to be in ~/dev/jigsaw and run:

cd ~/dev/jigsaw
bash configure

10.  make

time for cooking:

make images

11. post-build

Export a JIG enviroment variable to prefix your java commands and so use Jigsaw rather than the default openjdk:
64 bits vm:

export JIG=~/dev/jigsaw/build/linux-x86_64-normal-server-release/images/jdk-module-image/

or

32 bits vm:

 export JIG=~/dev/jigsaw/build/linux-x86-normal-server-release/images/jdk-module-image/

12. running Jigsaw?

$JIG/bin/java -version

should return something like:

openjdk version “1.8.0-internal”
OpenJDK Runtime Environment (build 1.8.0-internal-ludovic_2013_07_27_19_55-b00)
OpenJDK 64-Bit Server VM (build 25.0-b30, mixed mode)

and

$JIG/bin/jmod list -v

should return something like:

jdk@8-ea
  requires jdk.base@=8-ea
  requires public jdk.jre@=8-ea
  requires public jdk.tools@=8-ea

jdk.base@8-ea
  requires local optional jdk.desktop.internal@=8-ea
  requires optional jdk.jaxp@=8-ea
  requires local optional jdk.tls.internal@=8-ea
  requires local optional sun.charsets@=8-ea
  requires local optional sun.localedata@=8-ea
  requires local optional sun.resources@=8-ea
  provides java.base@8
  exports
    com.sun.nio.file
    com.sun.security.auth
    com.sun.security.auth.login
    java.beans
    java.io
    java.lang
    java.lang.annotation
    java.lang.invoke
    java.lang.module

running Jigsaw modules:

JPS:

$JIG/bin/java -m jdk.jps

or JConsole:

$JIG/bin/java -m jdk.jconsole

 Now is time to play…