Sunday 15 November 2009

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 variablesSource 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...

2 comments:

digital-ivan said...

Could you please post the full modules list? Or point at a website, where it can be viewed? Thank you.

Ludovic HOCHET said...

sorry I didn't see your comment until now, here is the list with today's code:
appletviewer@7-ea
apt@7-ea
attach@7-ea
debugging@7-ea
extcheck@7-ea
idlj@7-ea
jar@7-ea
jarsigner@7-ea
javac@7-ea
javadoc@7-ea
javah@7-ea
javap@7-ea
jaxws.tools@7-ea
jconsole@7-ea
jdb@7-ea
jdk@7-ea
jdk.base@7-ea
jdk.base.tools@7-ea
jdk.boot@7-ea
jdk.charsets@7-ea
jdk.corba@7-ea
jdk.deploy@7-ea
jdk.desktop@7-ea
jdk.enterprise@7-ea
jdk.httpserver@7-ea
jdk.instrument@7-ea
jdk.jarsigner@7-ea
jdk.jaxws@7-ea
jdk.jdbc@7-ea
jdk.jmx.connectors@7-ea
jdk.jndi@7-ea
jdk.jndi.cosnaming@7-ea
jdk.jndi.providers@7-ea
jdk.jre@7-ea
jdk.jre.tools@7-ea
jdk.kerberos@7-ea
jdk.langtools@7-ea
jdk.legacy@7-ea
jdk.localedata@7-ea
jdk.logging@7-ea
jdk.management@7-ea
jdk.prefs@7-ea
jdk.resources@7-ea
jdk.rmi@7-ea
jdk.scripting@7-ea
jdk.sctp@7-ea
jdk.security@7-ea
jdk.security.compat@7-ea
jdk.security.misc@7-ea
jdk.security.tools@7-ea
jdk.servicetag@7-ea
jdk.smartcardio@7-ea
jdk.sunec@7-ea
jdk.sunjce@7-ea
jdk.sunpkcs11@7-ea
jdk.tools@7-ea
jdk.xalan@7-ea
jdk.xerces@7-ea
jdk.xml@7-ea
jdk.xmldsig@7-ea
jhat@7-ea
jinfo@7-ea
jmap@7-ea
jpkg@7-ea
jps@7-ea
jrunscript@7-ea
jsadebugd@7-ea
jstack@7-ea
jstat@7-ea
jstatd@7-ea
jvmstat@7-ea
keytool@7-ea
native2ascii@7-ea
orbd@7-ea
pack200@7-ea
policytool@7-ea
rmic@7-ea
rmid@7-ea
rmiregistry@7-ea
sajdi@7-ea
schemagen@7-ea
serialver@7-ea
servertool@7-ea
sun.charsets@7-ea
sun.corba@7-ea
sun.deploy@7-ea
sun.desktop@7-ea
sun.enterprise@7-ea
sun.httpserver@7-ea
sun.instrument@7-ea
sun.jarsigner@7-ea
sun.jaxws@7-ea
sun.jdbc@7-ea
sun.jmx.connectors@7-ea
sun.jndi@7-ea
sun.jndi.cosnaming@7-ea
sun.jndi.providers@7-ea
sun.kerberos@7-ea
sun.langtools@7-ea
sun.legacy@7-ea
sun.localedata@7-ea
sun.logging@7-ea
sun.management@7-ea
sun.prefs@7-ea
sun.resources@7-ea
sun.rmi@7-ea
sun.scripting@7-ea
sun.sctp@7-ea
sun.security@7-ea
sun.security.compat@7-ea
sun.security.misc@7-ea
sun.security.tools@7-ea
sun.servicetag@7-ea
sun.smartcardio@7-ea
sun.sunec@7-ea
sun.sunjce@7-ea
sun.sunpkcs11@7-ea
sun.xalan@7-ea
sun.xerces@7-ea
sun.xml@7-ea
sun.xmldsig@7-ea
tnameserv@7-ea
wsgen@7-ea
wsimport@7-ea
xjc@7-ea