SlideShare a Scribd company logo
1 of 30
Download to read offline
#DevoxxFR
Building Your Own
JDK In 10 Steps
José Paumard
@JosePaumard
#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?)
#Devoxx @JosePaumard
Why building your own JDK?
And in fact you do not have to do it yourself!
#Devoxx @JosePaumard
Why building your own JDK?
And you can even get…
#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
#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
#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
#Devoxx @JosePaumard
Structure of the repository
http://hg.openjdk.java.net/valhalla/
#Devoxx @JosePaumard
Structure of the repository
http://hg.openjdk.java.net/amber/
#Devoxx @JosePaumard
Structure of the repository
http://hg.openjdk.java.net/loom/
#Devoxx @JosePaumard
Structure of the repository
http://hg.openjdk.java.net/loom/loom/
#Devoxx @JosePaumard
This is loom we want!
$ hg clone http://hg.openjdk.java.net/loom/loom/
ubuntu@ubuntu:~/jdk-builds/loom$ ls -l
total 60
-rw-r--r-- 1 ubuntu ubuntu 2114 Apr 10 11:51 ADDITIONAL_LICENSE_INFO
-rw-r--r-- 1 ubuntu ubuntu 1522 Apr 10 11:51 ASSEMBLY_EXCEPTION
drwxr-xr-x 3 ubuntu ubuntu 4096 Apr 10 11:51 bin
-rw-r--r-- 1 ubuntu ubuntu 1649 Apr 10 11:51 configure
drwxr-xr-x 3 ubuntu ubuntu 4096 Apr 10 11:51 doc
-rw-r--r-- 1 ubuntu ubuntu 19274 Apr 10 11:51 LICENSE
drwxr-xr-x 23 ubuntu ubuntu 4096 Apr 10 11:51 make
-rw-r--r-- 1 ubuntu ubuntu 2785 Apr 10 11:51 Makefile
-rw-r--r-- 1 ubuntu ubuntu 341 Apr 10 11:51 README
drwxr-xr-x 78 ubuntu ubuntu 4096 Apr 10 11:51 src
drwxr-xr-x 14 ubuntu ubuntu 4096 Apr 10 11:51 test
#Devoxx @JosePaumard
This is loom we want!
$ hg clone http://hg.openjdk.java.net/loom/loom/
$ du -s *
2542764 loom
2555176 valhalla
#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)
#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)
#Devoxx @JosePaumard
Branches
For Amber
$ hg branches
records 58586:367756dce66a
local-methods 58581:ef0e9ad164da
lambda-leftovers 58561:a9d1988be315
stats-before-this-super 58560:8c5aafc6c2c1
pattern-runtime 58559:83136411a3a0
records-and-sealed 58352:e62676fdb665
patterns-stage-1 58335:449afd3008d5
amber-demo-II 57904:c3e3f3b41490
patterns-deconstruction 57856:aa7b2dbc1a2a
concise-method-declarations 56872:e16b2019df86
enhanced-enums 56869:d521c8687ea8
default 58558:1bd307ea5497 (inactive)
patterns 57025:a898dc684456 (inactive)
#Devoxx @JosePaumard
Choosing a branch
For Amber
$ hg amber-demo-II
records 58586:367756dce66a
local-methods 58581:ef0e9ad164da
lambda-leftovers 58561:a9d1988be315
stats-before-this-super 58560:8c5aafc6c2c1
pattern-runtime 58559:83136411a3a0
records-and-sealed 58352:e62676fdb665
patterns-stage-1 58335:449afd3008d5
amber-demo-II 57904:c3e3f3b41490
patterns-deconstruction 57856:aa7b2dbc1a2a
concise-method-declarations 56872:e16b2019df86
enhanced-enums 56869:d521c8687ea8
default 58558:1bd307ea5497 (inactive)
patterns 57025:a898dc684456 (inactive)
#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
#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
#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)
#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)
#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
#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
#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
#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
...
#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
#Devoxx @JosePaumard
Result?
The result is in server-release/images/jdk/
$ ls -l build/linux-x86_64-server-release
total 120
-rw-r--r-- 1 ubuntu ubuntu 2663 Apr 15 02:21 bootcycle-spec.gmk
-rw-r--r-- 1 ubuntu ubuntu 7869 Apr 15 02:21 buildjdk-spec.gmk
-rw-r--r-- 1 ubuntu ubuntu 17895 Apr 15 02:31 build.log
drwxr-xr-x 19 ubuntu ubuntu 4096 Apr 15 02:31 buildtools
-rwxr-xr-x 1 ubuntu ubuntu 3908 Apr 15 02:21 compare.sh
-rw-r--r-- 1 ubuntu ubuntu 14971 Apr 15 02:21 configure.log
drwxr-xr-x 2 ubuntu ubuntu 4096 Apr 15 02:21 configure-support
drwxr-xr-x 3 ubuntu ubuntu 4096 Apr 15 02:22 hotspot
drwxr-xr-x 5 ubuntu ubuntu 4096 Apr 15 02:31 images
drwxr-xr-x 8 ubuntu ubuntu 4096 Apr 15 02:31 jdk
-rw-r--r-- 1 ubuntu ubuntu 1261 Apr 15 02:21 Makefile
drwxr-xr-x 6 ubuntu ubuntu 4096 Apr 15 02:22 make-support
-rw-r--r-- 1 ubuntu ubuntu 33489 Apr 15 02:21 spec.gmk
drwxr-xr-x 22 ubuntu ubuntu 4096 Apr 15 02:31 support
#Devoxx @JosePaumard
Result?
Result!
$ export JAVA_HOME= .../amber/build/linux-x86_64-server-release/images/jdk
$ export PATH=$JAVA_HOME/bin:$PATH
$ java –version
openjdk version "13-internal" 2019-09-17
OpenJDK Runtime Environment (build 13-internal+0-adhoc.ubuntu.amber)
OpenJDK 64-Bit Server VM (build 13-internal+0-adhoc.ubuntu.amber, mixed mode, sharing)
#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 ☺
#DevoxxFR
It’s your turn!
José Paumard
@JosePaumard

More Related Content

More from José Paumard

Construire son JDK en 10 étapes
Construire son JDK en 10 étapesConstruire son JDK en 10 étapes
Construire son JDK en 10 étapesJosé Paumard
 
Java Keeps Throttling Up!
Java Keeps Throttling Up!Java Keeps Throttling Up!
Java Keeps Throttling Up!José Paumard
 
Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2José Paumard
 
Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1José Paumard
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowJosé Paumard
 
JAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJosé Paumard
 
Collectors in the Wild
Collectors in the WildCollectors in the Wild
Collectors in the WildJosé Paumard
 
JAX RS and CDI bike the reactive bridge
JAX RS and CDI bike the reactive bridgeJAX RS and CDI bike the reactive bridge
JAX RS and CDI bike the reactive bridgeJosé Paumard
 
L'API Collector dans tous ses états
L'API Collector dans tous ses étatsL'API Collector dans tous ses états
L'API Collector dans tous ses étatsJosé Paumard
 
Linked to ArrayList: the full story
Linked to ArrayList: the full storyLinked to ArrayList: the full story
Linked to ArrayList: the full storyJosé Paumard
 
ArrayList et LinkedList sont dans un bateau
ArrayList et LinkedList sont dans un bateauArrayList et LinkedList sont dans un bateau
ArrayList et LinkedList sont dans un bateauJosé Paumard
 
Java SE 8 for Java EE developers
Java SE 8 for Java EE developersJava SE 8 for Java EE developers
Java SE 8 for Java EE developersJosé Paumard
 
Asynchronous API in Java8, how to use CompletableFuture
Asynchronous API in Java8, how to use CompletableFutureAsynchronous API in Java8, how to use CompletableFuture
Asynchronous API in Java8, how to use CompletableFutureJosé Paumard
 
Java 8 Streams and Rx Java Comparison
Java 8 Streams and Rx Java ComparisonJava 8 Streams and Rx Java Comparison
Java 8 Streams and Rx Java ComparisonJosé Paumard
 
Java SE 8 for Java EE developers
Java SE 8 for Java EE developersJava SE 8 for Java EE developers
Java SE 8 for Java EE developersJosé Paumard
 
Going reactive in java
Going reactive in javaGoing reactive in java
Going reactive in javaJosé Paumard
 

More from José Paumard (20)

Construire son JDK en 10 étapes
Construire son JDK en 10 étapesConstruire son JDK en 10 étapes
Construire son JDK en 10 étapes
 
Java Keeps Throttling Up!
Java Keeps Throttling Up!Java Keeps Throttling Up!
Java Keeps Throttling Up!
 
Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2
 
Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
 
Java Full Throttle
Java Full ThrottleJava Full Throttle
Java Full Throttle
 
JAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) Bridge
 
Collectors in the Wild
Collectors in the WildCollectors in the Wild
Collectors in the Wild
 
Streams in the wild
Streams in the wildStreams in the wild
Streams in the wild
 
JAX RS and CDI bike the reactive bridge
JAX RS and CDI bike the reactive bridgeJAX RS and CDI bike the reactive bridge
JAX RS and CDI bike the reactive bridge
 
Free your lambdas
Free your lambdasFree your lambdas
Free your lambdas
 
L'API Collector dans tous ses états
L'API Collector dans tous ses étatsL'API Collector dans tous ses états
L'API Collector dans tous ses états
 
Linked to ArrayList: the full story
Linked to ArrayList: the full storyLinked to ArrayList: the full story
Linked to ArrayList: the full story
 
Free your lambdas
Free your lambdasFree your lambdas
Free your lambdas
 
ArrayList et LinkedList sont dans un bateau
ArrayList et LinkedList sont dans un bateauArrayList et LinkedList sont dans un bateau
ArrayList et LinkedList sont dans un bateau
 
Java SE 8 for Java EE developers
Java SE 8 for Java EE developersJava SE 8 for Java EE developers
Java SE 8 for Java EE developers
 
Asynchronous API in Java8, how to use CompletableFuture
Asynchronous API in Java8, how to use CompletableFutureAsynchronous API in Java8, how to use CompletableFuture
Asynchronous API in Java8, how to use CompletableFuture
 
Java 8 Streams and Rx Java Comparison
Java 8 Streams and Rx Java ComparisonJava 8 Streams and Rx Java Comparison
Java 8 Streams and Rx Java Comparison
 
Java SE 8 for Java EE developers
Java SE 8 for Java EE developersJava SE 8 for Java EE developers
Java SE 8 for Java EE developers
 
Going reactive in java
Going reactive in javaGoing reactive in java
Going reactive in java
 

Recently uploaded

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 

Recently uploaded (20)

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 

Building your own JDK in 10 steps

  • 1. #DevoxxFR Building Your Own JDK In 10 Steps José Paumard @JosePaumard
  • 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?)
  • 3. #Devoxx @JosePaumard Why building your own JDK? And in fact you do not have to do it yourself!
  • 4. #Devoxx @JosePaumard Why building your own JDK? And you can even get…
  • 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
  • 8. #Devoxx @JosePaumard Structure of the repository http://hg.openjdk.java.net/valhalla/
  • 9. #Devoxx @JosePaumard Structure of the repository http://hg.openjdk.java.net/amber/
  • 10. #Devoxx @JosePaumard Structure of the repository http://hg.openjdk.java.net/loom/
  • 11. #Devoxx @JosePaumard Structure of the repository http://hg.openjdk.java.net/loom/loom/
  • 12. #Devoxx @JosePaumard This is loom we want! $ hg clone http://hg.openjdk.java.net/loom/loom/ ubuntu@ubuntu:~/jdk-builds/loom$ ls -l total 60 -rw-r--r-- 1 ubuntu ubuntu 2114 Apr 10 11:51 ADDITIONAL_LICENSE_INFO -rw-r--r-- 1 ubuntu ubuntu 1522 Apr 10 11:51 ASSEMBLY_EXCEPTION drwxr-xr-x 3 ubuntu ubuntu 4096 Apr 10 11:51 bin -rw-r--r-- 1 ubuntu ubuntu 1649 Apr 10 11:51 configure drwxr-xr-x 3 ubuntu ubuntu 4096 Apr 10 11:51 doc -rw-r--r-- 1 ubuntu ubuntu 19274 Apr 10 11:51 LICENSE drwxr-xr-x 23 ubuntu ubuntu 4096 Apr 10 11:51 make -rw-r--r-- 1 ubuntu ubuntu 2785 Apr 10 11:51 Makefile -rw-r--r-- 1 ubuntu ubuntu 341 Apr 10 11:51 README drwxr-xr-x 78 ubuntu ubuntu 4096 Apr 10 11:51 src drwxr-xr-x 14 ubuntu ubuntu 4096 Apr 10 11:51 test
  • 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)
  • 16. #Devoxx @JosePaumard Branches For Amber $ hg branches records 58586:367756dce66a local-methods 58581:ef0e9ad164da lambda-leftovers 58561:a9d1988be315 stats-before-this-super 58560:8c5aafc6c2c1 pattern-runtime 58559:83136411a3a0 records-and-sealed 58352:e62676fdb665 patterns-stage-1 58335:449afd3008d5 amber-demo-II 57904:c3e3f3b41490 patterns-deconstruction 57856:aa7b2dbc1a2a concise-method-declarations 56872:e16b2019df86 enhanced-enums 56869:d521c8687ea8 default 58558:1bd307ea5497 (inactive) patterns 57025:a898dc684456 (inactive)
  • 17. #Devoxx @JosePaumard Choosing a branch For Amber $ hg amber-demo-II records 58586:367756dce66a local-methods 58581:ef0e9ad164da lambda-leftovers 58561:a9d1988be315 stats-before-this-super 58560:8c5aafc6c2c1 pattern-runtime 58559:83136411a3a0 records-and-sealed 58352:e62676fdb665 patterns-stage-1 58335:449afd3008d5 amber-demo-II 57904:c3e3f3b41490 patterns-deconstruction 57856:aa7b2dbc1a2a concise-method-declarations 56872:e16b2019df86 enhanced-enums 56869:d521c8687ea8 default 58558:1bd307ea5497 (inactive) patterns 57025:a898dc684456 (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
  • 27. #Devoxx @JosePaumard Result? The result is in server-release/images/jdk/ $ ls -l build/linux-x86_64-server-release total 120 -rw-r--r-- 1 ubuntu ubuntu 2663 Apr 15 02:21 bootcycle-spec.gmk -rw-r--r-- 1 ubuntu ubuntu 7869 Apr 15 02:21 buildjdk-spec.gmk -rw-r--r-- 1 ubuntu ubuntu 17895 Apr 15 02:31 build.log drwxr-xr-x 19 ubuntu ubuntu 4096 Apr 15 02:31 buildtools -rwxr-xr-x 1 ubuntu ubuntu 3908 Apr 15 02:21 compare.sh -rw-r--r-- 1 ubuntu ubuntu 14971 Apr 15 02:21 configure.log drwxr-xr-x 2 ubuntu ubuntu 4096 Apr 15 02:21 configure-support drwxr-xr-x 3 ubuntu ubuntu 4096 Apr 15 02:22 hotspot drwxr-xr-x 5 ubuntu ubuntu 4096 Apr 15 02:31 images drwxr-xr-x 8 ubuntu ubuntu 4096 Apr 15 02:31 jdk -rw-r--r-- 1 ubuntu ubuntu 1261 Apr 15 02:21 Makefile drwxr-xr-x 6 ubuntu ubuntu 4096 Apr 15 02:22 make-support -rw-r--r-- 1 ubuntu ubuntu 33489 Apr 15 02:21 spec.gmk drwxr-xr-x 22 ubuntu ubuntu 4096 Apr 15 02:31 support
  • 28. #Devoxx @JosePaumard Result? Result! $ export JAVA_HOME= .../amber/build/linux-x86_64-server-release/images/jdk $ export PATH=$JAVA_HOME/bin:$PATH $ java –version openjdk version "13-internal" 2019-09-17 OpenJDK Runtime Environment (build 13-internal+0-adhoc.ubuntu.amber) OpenJDK 64-Bit Server VM (build 13-internal+0-adhoc.ubuntu.amber, mixed mode, sharing)
  • 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 ☺
  • 30. #DevoxxFR It’s your turn! José Paumard @JosePaumard