These are the slides of the Tools in Action I gave at Devoxx Belgium 2019.
The JDK is an open source project that you can download and build yourself! All the new things under work are available on Mercurial branches, that you can get and compile to test them before they are released. It allows you to play with them, see how they work, see what do the new syntaxes look like. In short: you can play now with a JDK from the future, that may never exist!
We will show how all this work, from the installation of a Ubuntu virtual machine to the execution of a home made JDK that will never be released.
2. #Devoxx @JosePaumard
Why building your own JDK?
For the fun of it!
You can build JDKs that do not exist yet!
And that will never exist!!
Are they really JDKs though? Hmmm… (TCK?)
5. #Devoxx @JosePaumard
Why building your own JDK?
https://hg.openjdk.java.net/
Top level repository of the Open JDK
65 projets available:
- amber, valhalla, loom, panama
- graal
- duke
6. #Devoxx @JosePaumard
Are you really building a JDK?
In fact no…
There is this TCK = Test Compatibility Kit
You need a licence to run it
LondonJug (LJC): Adopt OpenJDK
https://adoptopenjdk.net/
12 plateforms, 6 versions, 2 JVM
7. #Devoxx @JosePaumard
Let us start!
It needs some intallations
- Starting with Ubuntu Desktop 18.04
- Mercurial is not in the default installation
$ sudo apt-get install mercurial
13. #Devoxx @JosePaumard
This is loom we want!
$ hg clone http://hg.openjdk.java.net/loom/loom/
$ du -s *
2542764 loom
2555176 valhalla
14. #Devoxx @JosePaumard
Here the repo is not up to date
Updating a local repo
$ hg branches
fibers 54840:2c84b04740e1
processorid 54156:df063b0c6b16
cont 54839:8d1717a86bcc (inactive)
default 54838:9d0ae9508d53 (inactive)
15. #Devoxx @JosePaumard
Updating a local repo
$ hg pull
pulling from http://hg.openjdk.java.net/loom/loom/
searching for changes
adding changesets
adding manifests
adding file changes
added 1692 changesets with 11645 changes to 7333 files
new changesets 283cecb991fa:27a4185098e8
(run 'hg update' to get a working copy)
$ hg branches
fibers 56532:27a4185098e8
processorid 55689:7e07b78cbf78
cont 56531:9ae91a14c0f7 (inactive)
default 56521:ececb6dae777 (inactive)
18. #Devoxx @JosePaumard
Configuring the compilation
Autoconf FTW!
$ ./configure
Runnable configure script is not present
Generating runnable configure script at /home/ubuntu/jdk-builds/loom/build/.configure-
support/generated-configure.sh
Autoconf is not found on the PATH, and AUTOCONF is not set.
You need autoconf to be able to generate a runnable configure script.
You might be able to fix this by running 'sudo apt-get install autoconf’.
$ sudo apt-get install autoconf
19. #Devoxx @JosePaumard
Configuring the compilation
Autoconf FTW!
$ ./configure
configure: error: Cannot find GNU make 3.81 or newer! Please put it in the path, or add
e.g. MAKE=/opt/gmake3.81/make as argument to configure.
$ sudo apt-get install make
20. #Devoxx @JosePaumard
Configuring the compilation
Autoconf FTW!
$ ./configure
configure: error: Could not find a C compiler. You might be able to fix this by running
'sudo apt-get install build-essential'.
configure exiting with result code 1
$ sudo apt-get install build-essential (117Mo)
21. #Devoxx @JosePaumard
Configuring the compilation
Autoconf FTW…
$ ./configure
configure: error: Could not find X11 libraries. You might be able to fix this by running
'sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev
libxt-dev'.
configure exiting with result code 1
$ sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev
libxt-dev (20Mo)
22. #Devoxx @JosePaumard
Configuring the compilation
Autoconf FTW??
$ ./configure
configure: error: Could not find cups! You might be able to fix this by running 'sudo
apt-get install libcups2-dev'.
configure exiting with result code 1
$ sudo apt-get install libcups2-dev
23. #Devoxx @JosePaumard
Configuring the compilation
Autoconf FTW
$ ./configure
configure: error: Could not find alsa! You might be able to fix this by running 'sudo
apt-get install libasound2-dev'.
configure exiting with result code 1
$ sudo apt-get install libasound2-dev
24. #Devoxx @JosePaumard
Configuring the compilation
Autoconf FTW ☺
A new configuration has been successfully created in
/home/ubuntu/jdk-builds/loom/build/linux-x86_64-server-release
using default settings.
Configuration summary:
* Debug level: release
* HS debug level: product
* JVM variants: server
* JVM features: server: 'aot cds cmsgc compiler1 compiler2 epsilongc g1gc graal jfr jni-check jvmci jvmti management
nmt parallelgc serialgc services shenandoahgc vm-structs zgc'
* OpenJDK target: OS: linux, CPU architecture: x86, address length: 64
* Version string: 13-internal+0-adhoc.ubuntu.amber (13-internal)
Tools summary:
* Boot JDK: openjdk version "12" 2019-03-19 OpenJDK Runtime Environment (build 12+33) OpenJDK 64-Bit Server VM
(build 12+33, mixed mode, sharing) (at /home/ubuntu/jdk/jdk-12)
* Toolchain: gcc (GNU Compiler Collection)
* C Compiler: Version 7.3.0 (at /usr/bin/gcc)
* C++ Compiler: Version 7.3.0 (at /usr/bin/g++)
Build performance summary:
* Cores to use: 4
* Memory limit: 7953 MB
25. #Devoxx @JosePaumard
Launching the compilation
Make FTW! (make clean first…)
$ make images
Building target 'images' in configuration 'linux-x86_64-server-release'
Compiling 8 files for BUILD_TOOLS_LANGTOOLS
Compiling 1 files for BUILD_JFR_TOOLS
Creating hotspot/variant-server/tools/adlc/adlc from 13 file(s)
Compiling 2 files for BUILD_JVMTI_TOOLS
...
26. #Devoxx @JosePaumard
Launching the compilation
Make FTW!
$ make images
...
Creating support/demos/image/jfc/SampleTree/SampleTree.jar
Creating support/demos/image/jfc/TableExample/TableExample.jar
Creating support/demos/image/jfc/TransparentRuler/TransparentRuler.jar
Creating jdk image
Creating CDS archive for jdk image
Stopping sjavac server
Finished building target 'images' in configuration 'linux-x86_64-server-release'
$ du -s *
6287440 loom
6358412 amber
29. #Devoxx @JosePaumard
Wrapping up
A little tricky…
A little long!
Needs to make your hand dirty to test new functionalities
You will be fighting against your IDE, and you will loose!
But you can follow what is going on in real-time ☺