SlideShare a Scribd company logo
© Copyright Azul Systems 2016
© Copyright Azul Systems 2015
@speakjava
Modularization with Project
Jigsaw in JDK 9
Simon Ritter
Deputy CTO, Azul Systems
1
© Copyright Azul Systems 2016
Agenda
 JDK 9 API structure overview
 Introduction to Jigsaw and modules
 Developing code with modules
 Summary and further information
2
© Copyright Azul Systems 2016
JDK 9 API Structure Overview
3
© Copyright Azul Systems 2016
Goals For Project Jigsaw
 Make Java SE more scalable and flexible
 Improve security, maintainability and performance
 Simplify construction, deployment and maintenance of
large scale applications
 See how long you can keep a project going for
4
© Copyright Azul Systems 2016
API Classification
 Supported, intended for public use
– JCP specified: java.*, javax.*
– JDK specific: some com.sun.*, some jdk.*
 Unsupported, not intended for public use
– Mostly sun.*
– Most infamous is sun.misc.Unsafe
5
© Copyright Azul Systems 2016
General Java Compatability Policy
 If an application uses only supported APIs on version N of
Java it should work on version N+1, even without
recompilation
 Supported APIs can be removed, but only with advanced
notice
 To date 23 classes, 18 interfaces and 379 methods have
been deprecated
–None have been removed
6
© Copyright Azul Systems 2016
JDK 9: Incompatible Changes
 Encapsulate most JDK internal APIs
 Remove a small number of supported APIs
– 6 in total, all add/remove PropertyChangeListener
 Change the binary structure of the JRE and JDK
 Remove the endorsed-standards override and extension
mechanism
 New version string format
 A single underscore will no longer be allowed as an
identifier in source code
7
© Copyright Azul Systems 2016
Most Popular Unsupported APIs
1. sun.misc.BASE64Encoder
2. sun.misc.Unsafe
3. sun.misc.BASE64Decoder
8
Oracle dataset based on internal application code
© Copyright Azul Systems 2016
JDK Internal API Classification
 Non-critical
– Little or no use outside the JDK
– Used only for convenience (alternatives exist)
 Critical
– Functionality that would be difficult, if not impossible to
implement outside the JDK
9
© Copyright Azul Systems 2016
JEP 260 Proposal
1. Encapsulate all non-critical JDK-internal APIs
2. Encapsulate all critical JDK-internal APIs, for which
supported replacements exist in JDK 8
3. Do not encapsulate other critical JDK-internal APIs
– Deprecate these in JDK 9
– Plan to encapsulate or remove them in JDK 10
– Provide command-line option to access encapsulated
critical APIs
10
© Copyright Azul Systems 2016
Binary Structure Of JDK/JRE
 Potentially disruptive change
– Details in JEP 220
– Blurs the distinction between JRE and JDK
 Implemented since late 2014
– Allow people to get used to new organisation
11
© Copyright Azul Systems 2016
JDK Structure
bin
Pre-JDK 9 JDK 9
lib
tools.jar
jre
bin
rt.jar
lib
libconfbin
jre directory
tools.jar
rt.jar
© Copyright Azul Systems 2016
Introduction to Jigsaw and Modules
13
© Copyright Azul Systems 2016
Module Fundamentals
 Module is a grouping of code
– For Java this is a collection of packages
 The module can contain other things
– Native code
– Resources
– Configuration data
14
com.azul.zoop
com.azul.zoop.alpha.Name
com.azul.zoop.alpha.Position
com.azul.zoop.beta.Animal
com.azul.zoop.beta.Zoo
© Copyright Azul Systems 2016
Module Declaration
15
module com.azul.zoop {
}
module-info.java
com/azul/zoop/alpha/Name.java
com/azul/zoop/alpha/Position.java
com/azul/zoop/beta/Animal.java
com/azul/zoop/beta/Zoo.java
© Copyright Azul Systems 2016
Module Dependencies
module com.azul.zoop {
requires com.azul.zeta;
} com.azul.zoop
com.azul.zeta
© Copyright Azul Systems 2016
Module Dependencies
module com.azul.app {
requires com.azul.zoop;
requires java.sql;
}
com.azul.app
com.azul.zoop java.sql
© Copyright Azul Systems 2016
Module Dependency Graph
com.azul.app
java.base
java.sqlcom.azul.zoop
com.azul.zeta
java.xml java.logging
© Copyright Azul Systems 2016
Package Visibility
module com.azul.zoop {
exports com.azul.zoop.alpha;
exports com.azul.zoop.beta;
}
com.azul.zoop
com.azul.zoop.alpha
com.azul.zoop.beta com.azul.zoop.theta
© Copyright Azul Systems 2016
Accessibility
 For a package to be visible
– The package must be exported by the containing module
– The containing module must be read by the using module
 Public types from those packages can then be used
com.azul.zoopcom.azul.app
reads
© Copyright Azul Systems 2016
Readability v. Dependency
com.azul.app
java.sql
java.logging
module java.sql {
requires public java.logging;
}
Driver d = …
Logger l = d.getParentLogger();
l.log(“azul’);
© Copyright Azul Systems 2016
Module Readability Graph
com.azul.app
java.base
java.sqlcom.azul.zoop
com.azul.zeta
java.xml java.logging
© Copyright Azul Systems 2016
Java Accessibility (pre-JDK 9)
public
protected
<package>
private
© Copyright Azul Systems 2016
Java Accessibility (JDK 9)
public to everyone
public, but only to specific modules
public only within a module
protected
<package>
private
public ≠ accessible (fundamental change to Java)
© Copyright Azul Systems 2016
JDK Platform Modules
25
© Copyright Azul Systems 2016
Developing Code With Modules
26
© Copyright Azul Systems 2016
Compilation
27
$ javac –d mods 
src/zeta/module-info.java 
src/zeta/com/azul/zeta/Vehicle.java
mods/zeta/mod-info.class
mods/zeta/com/azul/zeta/Vehicle.class
src/zeta/mod-info.java
src/zeta/com/azul/zeta/Vehicle.java
© Copyright Azul Systems 2016
Module Path
$ javac –modulepath dir1:dir2:dir3
© Copyright Azul Systems 2016
Compilation With Module Path
29
$ javac –modulepath mlib –d mods 
src/zoop/module-info.java 
src/zoop/com/azul/zoop/alpha/Name.java
mods/zoop/mod-info.class
mods/zoop/com/azul/zoop/alpha/Name.class
src/zoop/mod-info.java
src/zoop/com/azul/zoop/alpha/Name.java
© Copyright Azul Systems 2016
Application Execution
 -modulepath can be abbreviated to -mp
$ java –modulepath mods –m com.azul.app/com.azul.app.Main
Azul application initialised!
module name main class
© Copyright Azul Systems 2016
Packaging With Modular Jars
mods/app/mod-info.class
mods/app/com/azul/app/Main.class
$ jar --create --file mlib/app.jar 
--main-class com.azul.app.Main 
-C mods .
module-info.class
com/azul/zoop/Main.class
app.jar
© Copyright Azul Systems 2016
Jar Files & Module Information
$ jar --file mlib/app.jar –p
Name:
com.azul.app
Requires:
com.azul.zoop
java.base [MANDATED]
java.sql
Main class:
com.azul.app.Main
© Copyright Azul Systems 2016
Application Execution (JAR)
$ java –mp mlib:mods –m com.azul.app.Main
Azul application initialised!
© Copyright Azul Systems 2016
Linking
Modular run-time
image
…confbin
jlink
$ jlink --modulepath $JDKMODS 
--addmods java.base –output myimage
$ myimage/bin/java –listmods
java.base@9.0
© Copyright Azul Systems 2016
Linking An Application
$ jlink --modulepath $JDKMODS:$MYMODS 
--addmods com.azul.app –output myimage
$ myimage/bin/java –listmods
java.base@9.0
java.logging@9.0
java.sql@9.0
java.xml@9.0
com.azul.app@1.0
com.azul.zoop@1.0
com.azul.zeta@1.0
© Copyright Azul Systems 2016
Summary & Further Information
36
© Copyright Azul Systems 2016
Summary
 Modularisation is a big change for Java
– JVM/JRE rather than language/APIs
– Public access isn’t necessarily the same
 Flexibility to define what is exported
 New linking capability to generate runtime image
 More to learn about converting existing code
 Will make all applications simpler to deploy and manage
37
© Copyright Azul Systems 2016
Further Information
 openjdk.java.net
 openjdk.java.net/jeps
– 200, 201, 220, 260, 261
 openjdk.java.net/projects/jigsaw
 jcp.org
– JSR 376
 www.zulu.org (OpenJDK supported builds JDK 6, 7, 8, 9)
 www.azul.com (Zing JVM for low latency)
38
© Copyright Azul Systems 2016
© Copyright Azul Systems 2015
@speakjava
Modularization with Project
Jigsaw in JDK 9
Simon Ritter
Deputy CTO, Azul Systems
39

More Related Content

What's hot

Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
Sander Mak (@Sander_Mak)
 
Java 9 and Project Jigsaw
Java 9 and Project JigsawJava 9 and Project Jigsaw
Java 9 and Project Jigsaw
DPC Consulting Ltd
 
Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?
Simon Ritter
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
Julien Dubois
 
JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?
Simon Ritter
 
Java Modularity: the Year After
Java Modularity: the Year AfterJava Modularity: the Year After
Java Modularity: the Year After
Sander Mak (@Sander_Mak)
 
Java 9 preview
Java 9 previewJava 9 preview
Java 9 preview
Ivan Krylov
 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
Sander Mak (@Sander_Mak)
 
55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
Simon Ritter
 
Modular Java
Modular JavaModular Java
Modular Java
Martin Toshev
 
JDK 9 Deep Dive
JDK 9 Deep DiveJDK 9 Deep Dive
JDK 9 Deep Dive
Simon Ritter
 
JavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring FrameworkJavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring Framework
Stephen Chin
 
Java EE, What's Next? by Anil Gaur
Java EE, What's Next? by Anil GaurJava EE, What's Next? by Anil Gaur
Java EE, What's Next? by Anil Gaur
Takashi Ito
 
JDK 9: The Start of a New Future for Java
JDK 9: The Start of a New Future for JavaJDK 9: The Start of a New Future for Java
JDK 9: The Start of a New Future for Java
Simon Ritter
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12
Simon Ritter
 
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
The latest features coming to Java 12
The latest features coming to Java 12The latest features coming to Java 12
The latest features coming to Java 12
NexSoftsys
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep Dive
Simon Ritter
 
Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9
Pavel Bucek
 
Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)
Robert Scholte
 

What's hot (20)

Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
 
Java 9 and Project Jigsaw
Java 9 and Project JigsawJava 9 and Project Jigsaw
Java 9 and Project Jigsaw
 
Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?
 
Java Modularity: the Year After
Java Modularity: the Year AfterJava Modularity: the Year After
Java Modularity: the Year After
 
Java 9 preview
Java 9 previewJava 9 preview
Java 9 preview
 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
 
55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
 
Modular Java
Modular JavaModular Java
Modular Java
 
JDK 9 Deep Dive
JDK 9 Deep DiveJDK 9 Deep Dive
JDK 9 Deep Dive
 
JavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring FrameworkJavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring Framework
 
Java EE, What's Next? by Anil Gaur
Java EE, What's Next? by Anil GaurJava EE, What's Next? by Anil Gaur
Java EE, What's Next? by Anil Gaur
 
JDK 9: The Start of a New Future for Java
JDK 9: The Start of a New Future for JavaJDK 9: The Start of a New Future for Java
JDK 9: The Start of a New Future for Java
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12
 
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
 
The latest features coming to Java 12
The latest features coming to Java 12The latest features coming to Java 12
The latest features coming to Java 12
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep Dive
 
Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9
 
Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)
 

Viewers also liked

Java 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature ListJava 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature List
Takipi
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
Sander Mak (@Sander_Mak)
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Rikard Thulin
 
OSGi for mere mortals
OSGi for mere mortalsOSGi for mere mortals
OSGi for mere mortals
Bertrand Delacretaz
 
Reducing technical debt in php
Reducing technical debt in phpReducing technical debt in php
Reducing technical debt in php
Carola Lilienthal
 
JFokus Java 9 contended locking performance
JFokus Java 9 contended locking performanceJFokus Java 9 contended locking performance
JFokus Java 9 contended locking performance
Monica Beckwith
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9
Simon Ritter
 
The Cuddly Throwable Application Server
The Cuddly Throwable Application ServerThe Cuddly Throwable Application Server
The Cuddly Throwable Application Server
Holly Cummins
 
Using Java 8 on Android
Using Java 8 on AndroidUsing Java 8 on Android
Using Java 8 on Android
Eduardo Felipe Ewert Bonet
 
Its all about the domain honey
Its all about the domain honeyIts all about the domain honey
Its all about the domain honey
Carola Lilienthal
 
Lambdas Hands On Lab
Lambdas Hands On LabLambdas Hands On Lab
Lambdas Hands On Lab
Simon Ritter
 
Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8
Simon Ritter
 
It's Java Jim, But Not As We Know It!
It's Java Jim, But Not As We Know It!It's Java Jim, But Not As We Know It!
It's Java Jim, But Not As We Know It!
Simon Ritter
 
Embracing Reactive Streams with Java 9 and Spring 5
Embracing Reactive Streams with Java 9 and Spring 5Embracing Reactive Streams with Java 9 and Spring 5
Embracing Reactive Streams with Java 9 and Spring 5
Wilder Rodrigues
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Mihail Stoynov
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
David Bosschaert
 
Why OSGi?
Why OSGi?Why OSGi?
Why OSGi?
bjhargrave
 
I/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew KurniadiI/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew Kurniadi
Dicoding
 
Java9 and Project Jigsaw
Java9 and Project JigsawJava9 and Project Jigsaw
Java9 and Project Jigsaw
takezoe
 
Project Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To JavaProject Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To Java
C4Media
 

Viewers also liked (20)

Java 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature ListJava 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature List
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4
 
OSGi for mere mortals
OSGi for mere mortalsOSGi for mere mortals
OSGi for mere mortals
 
Reducing technical debt in php
Reducing technical debt in phpReducing technical debt in php
Reducing technical debt in php
 
JFokus Java 9 contended locking performance
JFokus Java 9 contended locking performanceJFokus Java 9 contended locking performance
JFokus Java 9 contended locking performance
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9
 
The Cuddly Throwable Application Server
The Cuddly Throwable Application ServerThe Cuddly Throwable Application Server
The Cuddly Throwable Application Server
 
Using Java 8 on Android
Using Java 8 on AndroidUsing Java 8 on Android
Using Java 8 on Android
 
Its all about the domain honey
Its all about the domain honeyIts all about the domain honey
Its all about the domain honey
 
Lambdas Hands On Lab
Lambdas Hands On LabLambdas Hands On Lab
Lambdas Hands On Lab
 
Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8
 
It's Java Jim, But Not As We Know It!
It's Java Jim, But Not As We Know It!It's Java Jim, But Not As We Know It!
It's Java Jim, But Not As We Know It!
 
Embracing Reactive Streams with Java 9 and Spring 5
Embracing Reactive Streams with Java 9 and Spring 5Embracing Reactive Streams with Java 9 and Spring 5
Embracing Reactive Streams with Java 9 and Spring 5
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Why OSGi?
Why OSGi?Why OSGi?
Why OSGi?
 
I/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew KurniadiI/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew Kurniadi
 
Java9 and Project Jigsaw
Java9 and Project JigsawJava9 and Project Jigsaw
Java9 and Project Jigsaw
 
Project Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To JavaProject Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To Java
 

Similar to Modularization With Project Jigsaw in JDK 9

Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Patroklos Papapetrou (Pat)
 
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
Voxxed Days Thessaloniki
 
Jigsaw modularity
Jigsaw modularityJigsaw modularity
Jigsaw modularity
Srinivasan Raghavan
 
Advanced modular development
Advanced modular development  Advanced modular development
Advanced modular development
Srinivasan Raghavan
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
Simon Ritter
 
JDK 9: Migrating Applications
JDK 9: Migrating ApplicationsJDK 9: Migrating Applications
JDK 9: Migrating Applications
Simon Ritter
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019
Shaun Smith
 
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013Martin Fousek
 
JDK 10 Java Module System
JDK 10 Java Module SystemJDK 10 Java Module System
JDK 10 Java Module System
Wolfgang Weigend
 
Java8 - Under the hood
Java8 - Under the hoodJava8 - Under the hood
Java8 - Under the hood
Lakshmi Narasimhan
 
JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after Modularity
DanHeidinga
 
Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module System
Tim Ellison
 
Why should i switch to Java SE 7
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7Vinay H G
 
Modularization in java 8
Modularization in java 8Modularization in java 8
Modularization in java 8
pgt technology scouting GmbH
 
JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
David Delabassee
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
Mert Çalışkan
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9
Deepu Xavier
 
Java 9 / Jigsaw - AJUG/VJUG session
Java 9 / Jigsaw - AJUG/VJUG  sessionJava 9 / Jigsaw - AJUG/VJUG  session
Java 9 / Jigsaw - AJUG/VJUG session
Mani Sarkar
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
David Delabassee
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
David Delabassee
 

Similar to Modularization With Project Jigsaw in JDK 9 (20)

Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
 
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
 
Jigsaw modularity
Jigsaw modularityJigsaw modularity
Jigsaw modularity
 
Advanced modular development
Advanced modular development  Advanced modular development
Advanced modular development
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
JDK 9: Migrating Applications
JDK 9: Migrating ApplicationsJDK 9: Migrating Applications
JDK 9: Migrating Applications
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019
 
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
 
JDK 10 Java Module System
JDK 10 Java Module SystemJDK 10 Java Module System
JDK 10 Java Module System
 
Java8 - Under the hood
Java8 - Under the hoodJava8 - Under the hood
Java8 - Under the hood
 
JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after Modularity
 
Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module System
 
Why should i switch to Java SE 7
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7
 
Modularization in java 8
Modularization in java 8Modularization in java 8
Modularization in java 8
 
JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9
 
Java 9 / Jigsaw - AJUG/VJUG session
Java 9 / Jigsaw - AJUG/VJUG  sessionJava 9 / Jigsaw - AJUG/VJUG  session
Java 9 / Jigsaw - AJUG/VJUG session
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
 

More from Simon Ritter

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
Simon Ritter
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
Simon Ritter
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type Patterns
Simon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
Simon Ritter
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
Simon Ritter
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern Java
Simon Ritter
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
Simon Ritter
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New Features
Simon Ritter
 
Java after 8
Java after 8Java after 8
Java after 8
Simon Ritter
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDK
Simon Ritter
 
Java Programming
Java ProgrammingJava Programming
Java Programming
Simon Ritter
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans Technology
Simon Ritter
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java Technology
Simon Ritter
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?
Simon Ritter
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
Simon Ritter
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still Free
Simon Ritter
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
Simon Ritter
 
Java Support: What's changing
Java Support:  What's changingJava Support:  What's changing
Java Support: What's changing
Simon Ritter
 
Building a Brain with Raspberry Pi and Zulu Embedded JVM
Building a Brain with Raspberry Pi and Zulu Embedded JVMBuilding a Brain with Raspberry Pi and Zulu Embedded JVM
Building a Brain with Raspberry Pi and Zulu Embedded JVM
Simon Ritter
 
It's Java, Jim, but not as we know it
It's Java, Jim, but not as we know itIt's Java, Jim, but not as we know it
It's Java, Jim, but not as we know it
Simon Ritter
 

More from Simon Ritter (20)

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type Patterns
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern Java
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New Features
 
Java after 8
Java after 8Java after 8
Java after 8
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDK
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans Technology
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java Technology
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still Free
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
Java Support: What's changing
Java Support:  What's changingJava Support:  What's changing
Java Support: What's changing
 
Building a Brain with Raspberry Pi and Zulu Embedded JVM
Building a Brain with Raspberry Pi and Zulu Embedded JVMBuilding a Brain with Raspberry Pi and Zulu Embedded JVM
Building a Brain with Raspberry Pi and Zulu Embedded JVM
 
It's Java, Jim, but not as we know it
It's Java, Jim, but not as we know itIt's Java, Jim, but not as we know it
It's Java, Jim, but not as we know it
 

Recently uploaded

2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 

Recently uploaded (20)

2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 

Modularization With Project Jigsaw in JDK 9

  • 1. © Copyright Azul Systems 2016 © Copyright Azul Systems 2015 @speakjava Modularization with Project Jigsaw in JDK 9 Simon Ritter Deputy CTO, Azul Systems 1
  • 2. © Copyright Azul Systems 2016 Agenda  JDK 9 API structure overview  Introduction to Jigsaw and modules  Developing code with modules  Summary and further information 2
  • 3. © Copyright Azul Systems 2016 JDK 9 API Structure Overview 3
  • 4. © Copyright Azul Systems 2016 Goals For Project Jigsaw  Make Java SE more scalable and flexible  Improve security, maintainability and performance  Simplify construction, deployment and maintenance of large scale applications  See how long you can keep a project going for 4
  • 5. © Copyright Azul Systems 2016 API Classification  Supported, intended for public use – JCP specified: java.*, javax.* – JDK specific: some com.sun.*, some jdk.*  Unsupported, not intended for public use – Mostly sun.* – Most infamous is sun.misc.Unsafe 5
  • 6. © Copyright Azul Systems 2016 General Java Compatability Policy  If an application uses only supported APIs on version N of Java it should work on version N+1, even without recompilation  Supported APIs can be removed, but only with advanced notice  To date 23 classes, 18 interfaces and 379 methods have been deprecated –None have been removed 6
  • 7. © Copyright Azul Systems 2016 JDK 9: Incompatible Changes  Encapsulate most JDK internal APIs  Remove a small number of supported APIs – 6 in total, all add/remove PropertyChangeListener  Change the binary structure of the JRE and JDK  Remove the endorsed-standards override and extension mechanism  New version string format  A single underscore will no longer be allowed as an identifier in source code 7
  • 8. © Copyright Azul Systems 2016 Most Popular Unsupported APIs 1. sun.misc.BASE64Encoder 2. sun.misc.Unsafe 3. sun.misc.BASE64Decoder 8 Oracle dataset based on internal application code
  • 9. © Copyright Azul Systems 2016 JDK Internal API Classification  Non-critical – Little or no use outside the JDK – Used only for convenience (alternatives exist)  Critical – Functionality that would be difficult, if not impossible to implement outside the JDK 9
  • 10. © Copyright Azul Systems 2016 JEP 260 Proposal 1. Encapsulate all non-critical JDK-internal APIs 2. Encapsulate all critical JDK-internal APIs, for which supported replacements exist in JDK 8 3. Do not encapsulate other critical JDK-internal APIs – Deprecate these in JDK 9 – Plan to encapsulate or remove them in JDK 10 – Provide command-line option to access encapsulated critical APIs 10
  • 11. © Copyright Azul Systems 2016 Binary Structure Of JDK/JRE  Potentially disruptive change – Details in JEP 220 – Blurs the distinction between JRE and JDK  Implemented since late 2014 – Allow people to get used to new organisation 11
  • 12. © Copyright Azul Systems 2016 JDK Structure bin Pre-JDK 9 JDK 9 lib tools.jar jre bin rt.jar lib libconfbin jre directory tools.jar rt.jar
  • 13. © Copyright Azul Systems 2016 Introduction to Jigsaw and Modules 13
  • 14. © Copyright Azul Systems 2016 Module Fundamentals  Module is a grouping of code – For Java this is a collection of packages  The module can contain other things – Native code – Resources – Configuration data 14 com.azul.zoop com.azul.zoop.alpha.Name com.azul.zoop.alpha.Position com.azul.zoop.beta.Animal com.azul.zoop.beta.Zoo
  • 15. © Copyright Azul Systems 2016 Module Declaration 15 module com.azul.zoop { } module-info.java com/azul/zoop/alpha/Name.java com/azul/zoop/alpha/Position.java com/azul/zoop/beta/Animal.java com/azul/zoop/beta/Zoo.java
  • 16. © Copyright Azul Systems 2016 Module Dependencies module com.azul.zoop { requires com.azul.zeta; } com.azul.zoop com.azul.zeta
  • 17. © Copyright Azul Systems 2016 Module Dependencies module com.azul.app { requires com.azul.zoop; requires java.sql; } com.azul.app com.azul.zoop java.sql
  • 18. © Copyright Azul Systems 2016 Module Dependency Graph com.azul.app java.base java.sqlcom.azul.zoop com.azul.zeta java.xml java.logging
  • 19. © Copyright Azul Systems 2016 Package Visibility module com.azul.zoop { exports com.azul.zoop.alpha; exports com.azul.zoop.beta; } com.azul.zoop com.azul.zoop.alpha com.azul.zoop.beta com.azul.zoop.theta
  • 20. © Copyright Azul Systems 2016 Accessibility  For a package to be visible – The package must be exported by the containing module – The containing module must be read by the using module  Public types from those packages can then be used com.azul.zoopcom.azul.app reads
  • 21. © Copyright Azul Systems 2016 Readability v. Dependency com.azul.app java.sql java.logging module java.sql { requires public java.logging; } Driver d = … Logger l = d.getParentLogger(); l.log(“azul’);
  • 22. © Copyright Azul Systems 2016 Module Readability Graph com.azul.app java.base java.sqlcom.azul.zoop com.azul.zeta java.xml java.logging
  • 23. © Copyright Azul Systems 2016 Java Accessibility (pre-JDK 9) public protected <package> private
  • 24. © Copyright Azul Systems 2016 Java Accessibility (JDK 9) public to everyone public, but only to specific modules public only within a module protected <package> private public ≠ accessible (fundamental change to Java)
  • 25. © Copyright Azul Systems 2016 JDK Platform Modules 25
  • 26. © Copyright Azul Systems 2016 Developing Code With Modules 26
  • 27. © Copyright Azul Systems 2016 Compilation 27 $ javac –d mods src/zeta/module-info.java src/zeta/com/azul/zeta/Vehicle.java mods/zeta/mod-info.class mods/zeta/com/azul/zeta/Vehicle.class src/zeta/mod-info.java src/zeta/com/azul/zeta/Vehicle.java
  • 28. © Copyright Azul Systems 2016 Module Path $ javac –modulepath dir1:dir2:dir3
  • 29. © Copyright Azul Systems 2016 Compilation With Module Path 29 $ javac –modulepath mlib –d mods src/zoop/module-info.java src/zoop/com/azul/zoop/alpha/Name.java mods/zoop/mod-info.class mods/zoop/com/azul/zoop/alpha/Name.class src/zoop/mod-info.java src/zoop/com/azul/zoop/alpha/Name.java
  • 30. © Copyright Azul Systems 2016 Application Execution  -modulepath can be abbreviated to -mp $ java –modulepath mods –m com.azul.app/com.azul.app.Main Azul application initialised! module name main class
  • 31. © Copyright Azul Systems 2016 Packaging With Modular Jars mods/app/mod-info.class mods/app/com/azul/app/Main.class $ jar --create --file mlib/app.jar --main-class com.azul.app.Main -C mods . module-info.class com/azul/zoop/Main.class app.jar
  • 32. © Copyright Azul Systems 2016 Jar Files & Module Information $ jar --file mlib/app.jar –p Name: com.azul.app Requires: com.azul.zoop java.base [MANDATED] java.sql Main class: com.azul.app.Main
  • 33. © Copyright Azul Systems 2016 Application Execution (JAR) $ java –mp mlib:mods –m com.azul.app.Main Azul application initialised!
  • 34. © Copyright Azul Systems 2016 Linking Modular run-time image …confbin jlink $ jlink --modulepath $JDKMODS --addmods java.base –output myimage $ myimage/bin/java –listmods java.base@9.0
  • 35. © Copyright Azul Systems 2016 Linking An Application $ jlink --modulepath $JDKMODS:$MYMODS --addmods com.azul.app –output myimage $ myimage/bin/java –listmods java.base@9.0 java.logging@9.0 java.sql@9.0 java.xml@9.0 com.azul.app@1.0 com.azul.zoop@1.0 com.azul.zeta@1.0
  • 36. © Copyright Azul Systems 2016 Summary & Further Information 36
  • 37. © Copyright Azul Systems 2016 Summary  Modularisation is a big change for Java – JVM/JRE rather than language/APIs – Public access isn’t necessarily the same  Flexibility to define what is exported  New linking capability to generate runtime image  More to learn about converting existing code  Will make all applications simpler to deploy and manage 37
  • 38. © Copyright Azul Systems 2016 Further Information  openjdk.java.net  openjdk.java.net/jeps – 200, 201, 220, 260, 261  openjdk.java.net/projects/jigsaw  jcp.org – JSR 376  www.zulu.org (OpenJDK supported builds JDK 6, 7, 8, 9)  www.azul.com (Zing JVM for low latency) 38
  • 39. © Copyright Azul Systems 2016 © Copyright Azul Systems 2015 @speakjava Modularization with Project Jigsaw in JDK 9 Simon Ritter Deputy CTO, Azul Systems 39

Editor's Notes

  1. com.sun API examples mostly around tooling jdk API example is nashorn
  2. 6 APIs are in LogManager and Pack200