SlideShare a Scribd company logo
Java 9 / Jigsaw
Modularisation & more
Presenters
Simon Maple
@sjmaple
Mani Sarkar
@theNeomatrix369
Hosts - Atlanta JUG
Pratik Patel
@prpatel
Vince May
@vincentmayers
Our guest
Heather VanCura
@heathervc
Agenda
- Session 1: Introduction
- What is meant by Modularisation in Java 9?
- Session 2: JLink
- Lunch break: lunch + 10/15 minute optional jigsaw session
- Session 3: Migrating non-modular app to Java 9 or JShell
- Feedback
- Contribution
- Resources
How to share your (live) feedback with us?
Discussion/technical corner, share your thoughts, code snippets,
issues, feedback with us while you code away...
http://bit.ly/J9HackDay-AJUG-feedback
We have left a few
issues for you to find,
investigate, solve, report
to us or the OpenJDK /
JDK9 team
Setup
Is everyone setup, and ready to go?
http://bit.ly/J9HackDay-repo
You have this link via email / meetup message!
Read through till the end of the README.md
Session 1: Introduction: Java 9 modularisation
15 minutes
What is meant by Modularisation in Java 9?
JDK
module java.base
package java.io
class Console
...
package java.lang
class String
...
module java.logging
package java.util.logging
class FileHandler
class LogManager
...
module java.sql
package java.sql
class Connection
class SqlData
...
Java, the language: split into modules
modules...
packages...
classes...
What is meant by Modularisation in Java 9?
java.base
java.sql
other
modules...
java.logging
Java, the language: dependency graph
java.xml
implicit implicit
explicit
(requires)
explicit
(requires)
implicit
JDK
What is meant by Modularisation in Java 9?
Java, the language: dependency graph
java.base
java.sql
other
modules...
java.logging java.xml
implicit implicit
explicit
(requires)
explicit
(requires)
implicit
JDK
Our Java
applications
explicit
(requires)
explicit
implicit
What is meant by Modularisation in Java 9?
Pre-Java 9
Java 9/Jigsaw
src/main/java
package a.b.c
class p
class q
package m.n.o
class s
class t
src/main/java
module a.b.c
package a.b.c
class p
class q
module m.n.o
package m.n.o
class s
class t
Structure of
a typical
Java app.
containing
packages...
Create your own
modules
containing
packages, classes...
What is meant by Modularisation in Java 9?
Typical package structure Modules contain packages
Credits to Paul Bakker & Sander Mak
package books.api.entities
classes
package bookstore.api.service
What is looks like from the file system?
What is meant by Modularisation in Java 9?
Typical package structure Modules contain packages
Credits to Paul Bakker & Sander Mak
contains module
visibility
(readability) &
dependency info
module books.api contains
package books.api.entities
package books.api.service
modules
What is looks like from the file system?
What is meant by Modularisation in Java 9?
module com.abc {
requires com.abc.pqr;
requires transitive com.xyz.abc;
exports com.abc.def.alpha;
exports com.abc.pqr.beta to
com.ijk.mno,
com.lmn.stu;
uses java.network.Driver;
provides java.sql.Driver with com.mno.def.Driver;
}
module
definition
defines dependencies of module, to modules
com.abc.pqr & com.xyz.abc
transitive keyword defines
implicit dependency
module name
How is module dependencies are defined in Java 9?
module-info.java
What is meant by Modularisation in Java 9?
module com.abc {
requires com.abc.pqr;
requires transitive com.xyz.abc;
exports com.abc.def.alpha;
exports com.abc.pqr.beta to
com.ijk.mno,
com.lmn.stu;
uses java.network.Driver;
provides java.sql.Driver with com.mno.def.Driver;
}
module
definition
make all & only public types in specified
packages available to other modules
How is module dependencies are defined in Java 9?
module name
… or make available
to specified modules
module-info.java
What is meant by Modularisation in Java 9?
module com.abc {
requires com.abc.pqr;
requires transitive com.xyz.abc;
exports com.abc.def.alpha;
exports com.abc.pqr.beta to
com.ijk.mno,
com.lmn.stu;
uses java.network.Driver;
provides java.sql.Driver with com.mno.def.Driver;
}
module-info.java
module
definition
this module publishes
a service provider
this module uses a service provider
published by another module
module name
How is module dependencies are defined in Java 9?
Link to all the exercises!
http://bit.ly/J9Hackday-exercises
Session 1: Hands-on: Java 9 modularisation
60 minutes
http://bit.ly/J9HackDay-session-1-jigsaw-intro
(http://bit.ly/J9HackDay-repo)
Session 1: feedback
15 minutes
http://bit.ly/J9HackDay-AJUG-feedback
Lunch break
60 minutes
Short 10/15 minutes covering intro/background/fundamentals (talk while having a bite of food and drink)
What is meant by Modularisation in Java 9?
A bit of fundamentals and background before we get to the answer
What is meant by Modularisation in Java 9?
modularisation
Pre-Java 9 Java 9
Anomalies
OpenJDK& JDK
What is meant by Modularisation in Java 9?
How we perceive the JDK/JRE from a developer’s / end-user’s perspective?
JDK or
JRE
IBM
Other
vendors
Oracle download
Create
Client
Apps
distribute
Client
Apps +
bundle
JRE
What is meant by Modularisation in Java 9?
How the maintainers of Java perceive it?
Distribute
built apps
+ bundle
JDK
IBM
Other
vendors
Oracle build downloadOpenJDK JDK
What is meant by Modularisation in Java 9?
Modularisation of OpenJDK sources (JEP 201 and related JEPs)
Binary
compatible
JDK
re-organise rebuild
OpenJDK
source
Refactored
OpenJDK
source
Repository
JDK
re-organise
Improved layout of
source folders in
the JDK repository
What is meant by Modularisation in Java 9?
Modularisation of Runtime Images (JEP 220 and related JEPs)
Binary
compatible
JDK
re-organise rebuild
Runtime
JDK
Optimised
(modular)
JDK
Runtime
Traditional
Runtime JDK
Image
re-organise
A more compact
Runtime JDK Image
What is meant by Modularisation in Java 9?
Modularisation of Java Packages and Application Packaging (JEP 275 and related JEPs)
Modular Java 9
application +
custom JDK
compiles creates
Modularised
JDK Runtime
Modular
Java 9
source
JLink Smaller JDK footprint
Java 9
applicationcompiles creates
Modularised
JDK Runtime
Non-modular
Java 9 source
Binary compatible
creates
What is meant by Modularisation in Java 9?
JSR 376: Java Platform Module System played the primary role
http://openjdk.java.net/projects/jigsaw/spec/
What is meant by Modularisation in Java 9?
JEPs that lead to all the new features in Java 9 (including
Jigsaw):
- 200: The Modular JDK
- 201: Modular Source Code
- 220: Modular Run-Time Images (depends on JEP 162)
- 260: Encapsulate Most Internal APIs (no dependencies)
- 261: Module System (dependens on JEP 220, related to JEP 238)
- 282: jlink: The Java Linker (replaces implementation of JEP 220)
- 275: Modular Java Application Packaging
- 222: jshell: The Java Shell (Read-Eval-Print Loop)
- 193: Variable Handles
- 110: HTTP 2 Client
- 238: Multi-Release JAR Files
- 158: Unified JVM Logging
- G1 related JEPs (3)
- JEPs related to a number of security improvements
- JEPs related to a number of platform improvements
- >>> Many, many more JEPs, see the Java 9 JEPs list for further details <<<
What is meant by Modularisation in Java 9?
JDK 9& Jigsaw feature distribution
...
Other
JDK 9
features
Jigsaw
...
...
...
... ... ... ...
...
...
...
...
...
...
...
...
Why Modularisation in Java 9?
But, why?
It’s been worked on for about a decade:
- Reliable Configuration
- define module dependencies
- resolve classpath issues
- Strong Encapsulation
- define or hiding away what’s not intended or necessary
for public access
- JDK internal APIs (sun.misc.unsafe, security,
etc…)
- within APIs of our own applications
Why Modularisation in Java 9?
Other side effects and benefits:
- Decluttering of code bases (loose coupling & high cohesion)
- OpenJDK sources
- JDK sources
- Our Java App sources (post migration and refactoring)
- Customised runtime JDK (smaller footprint)
- Highly desirable for IoT, arduino/embedded devices,
etc…
- Improve distribution and runtime performance
- Any more?
Why Modularisation in Java 9?
Why Modularisation in Java 9?
Important Java 9
concepts & terminologies
Concepts & terminologies
- module
- modular JAR
- accessibility
- implied readability
- automatic module
- unnamed module
- open module
- open package
- split packages
Important Java 9 Concepts & Terminologies
Credits: Oleg Tsal-Tsalko & Nicolai Parlog
module
- named (via module-info.java)
- self-describing collection of code and data
- declares which other modules it requires
- exports one or more packages to other
modules
Important Java 9 Concepts & Terminologies
modular JAR
- like any other JAR file
- contains module-info.class in its root
directory
Important Java 9 Concepts & Terminologies
accessibility
(accessibility of types between modules)
- type must be public
- module exports the package containing
the type
- module depending on it declares it as
required (requires)
Important Java 9 Concepts & Terminologies
implied readability
(direct & implied readability)
Important Java 9 Concepts & Terminologies
readsmodule A
requires B
module B
exports ...
readsmodule A
requires B
module B
exports …
requires C
reads module C
exports ...
module A indirectly reads module C
module A
directly reads
module B
automatic module
- any (non-modular) JAR file placed on the MODULEPATH
- module name is derived from the jar name
- can have no module name if compiler fails to derive from the jar name
- does not contain the module descriptor file module-info.java
- exports everything
- reads all modules including unnamed modules
- not open for reflective access (unless directives are used)
Important Java 9 Concepts & Terminologies
named module
- modular JAR file placed on the MODULEPATH
- module name is derived from the module-info.java
descriptor file
- exports only packages that are declared exports
- reads only modules declared as requires
- not open for deep reflective access (unless directives are
used)
Important Java 9 Concepts & Terminologies
unnamed module
- any (non-modular) JAR file placed on the CLASSPATH
- module name is not derived from the jar name
- does not contain module-info.java descriptor file
- exports everything
- reads all modules except cannot read unnamed modules
- open for deep reflective access (for backward
compatibility)
Important Java 9 Concepts & Terminologies
automatic v/s unnamed modules
- they are the same, except
- automatic module: any (non-modular) JAR file placed
on the MODULEPATH
- unnamed module: any (non-modular) JAR file placed on
the CLASSPATH
- automatic modules get their names from the jar,
unnamed modules as the name states, is not named
Important Java 9 Concepts & Terminologies
open module
- a module declared for deep reflective access by other
modules (to help migration)
- declared in the module-info.java
Important Java 9 Concepts & Terminologies
open module foo.bar {
exports com.foo.bar;
requires hibernate.core;
requires hibernate.entitymanager;
}
open module
open package
- a package declared for deep reflective access by other
modules (to help migration)
- declared in the module-info.java
Important Java 9 Concepts & Terminologies
module foo.bar {
exports com.foo.bar;
opens com.foo.bar.model;
requires hibernate.core;
requires hibernate.entitymanager;
}
open package
split packages
- Two or more modules containing the same package
results
- strictly checked for Java 9 modules (named)
- not checked for unnamed modules
- causes the package to become invisible
Important Java 9 Concepts & Terminologies
Not everything can be covered but let’s find out about these topics:
- difference between classpath and module path
- kill switch (remove Jigsaw restrictions):
- java --permit-illegal-access …
- Jlink CLI option: --launcher
- maven, ant or gradle integrations
- and many more topics…
- checkout the resources on http://bit.ly/Java-9-Resources
So many things to cover!
https://github.com/accso/java9-jigsaw-depvis
Visualise your dependencies!
Session 2: Introduction: JLink
10 minutes
Session 2: Introduction: JLink
Create a package
distributable, that
runs on any platform,
but needs a platform
specific JDK
JDK (javac)
Your App
packages
& classes
Your App
package
(distributable)
JVM, the
Platform
Java, the
language
(packages &
classes)
Any JRE/JDK
compiles
creates
Pre-Java 9
depends on (needs), to run
Session 2: Introduction: JLink
JDK
modules
JLink
JVM, the
Platform
Java, the
language (JDK
modules)
Your App
modules
Create standalone
distributable (smaller
footprint), that runs
on a specific platform
Your App
modules
JDK compiles
creates
Java 9
Session 2: Hands-on: JLink
40 minutes
http://bit.ly/J9HackDay-session-2-jlink
(http://bit.ly/J9HackDay-repo)
Session 2: feedback
10 minutes
http://bit.ly/J9HackDay-AJUG-feedback
Session 3: Introduction: Migration or JShell
15 minutes
Session 3: Introduction: Migration or JShell
Session 3 hands-on: Migration or JShell
60 minutes
http://bit.ly/J9HackDay-session-3-jshell
(http://bit.ly/J9HackDay-repo)
Session 3 & overall: feedback
15-30 minutes
http://bit.ly/J9HackDay-AJUG-feedback
Contribute
Don’t like something or like something a lot,
want to contribute to make things better?
http://bit.ly/AdoptOpenJDK-contribute
Feedback
We value your feedback, make Java better
with your constructive feedback
http://bit.ly/AdoptOpenJDK-feedback
Resources
Want to know about the other features of Java 9:
http://bit.ly/Java-9-Resources
Thank you to all
Thank you for your continued support
9
@atlantajug
@virtualJug
@adoptopenjdk
@openjdk
@jcp_org
@java

More Related Content

What's hot

Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
Hirofumi Iwasaki
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
sbobde
 
Oracle History #5
Oracle History #5Oracle History #5
Oracle History #5
Kyung Sang Jang
 
Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010Codecamp Romania
 
The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011
Arun Gupta
 
Java one 2015 [con3339]
Java one 2015 [con3339]Java one 2015 [con3339]
Java one 2015 [con3339]
Arshal Ameen
 
History of java
History of javaHistory of java
History of java
Mani Sarkar
 
Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Shreedhar Ganapathy
 
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Edureka!
 
Java for XPages Development
Java for XPages DevelopmentJava for XPages Development
Java for XPages Development
Teamstudio
 
Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3
Arun Gupta
 
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
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
Ryan Cuprak
 
Connect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages DevelopmentConnect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages Development
panagenda
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
Julien Dubois
 
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
Rakuten Group, Inc.
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Marakana Inc.
 
History of Java 2/2
History of Java 2/2History of Java 2/2
History of Java 2/2
Eberhard Wolff
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
Murat Yener
 

What's hot (20)

Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
 
Java 7 workshop
Java 7 workshopJava 7 workshop
Java 7 workshop
 
Oracle History #5
Oracle History #5Oracle History #5
Oracle History #5
 
Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010
 
The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011
 
Java one 2015 [con3339]
Java one 2015 [con3339]Java one 2015 [con3339]
Java one 2015 [con3339]
 
History of java
History of javaHistory of java
History of java
 
Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Java EE 6 Component Model Explained
Java EE 6 Component Model Explained
 
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
 
Java for XPages Development
Java for XPages DevelopmentJava for XPages Development
Java for XPages Development
 
Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3
 
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
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
Connect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages DevelopmentConnect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages Development
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
History of Java 2/2
History of Java 2/2History of Java 2/2
History of Java 2/2
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
 

Similar to Java 9 / Jigsaw - AJUG/VJUG session

Java 9 Module System
Java 9 Module SystemJava 9 Module System
Java 9 Module System
Hasan Ünal
 
Java9
Java9Java9
Java 9 Modularity and Project Jigsaw
Java 9 Modularity and Project JigsawJava 9 Modularity and Project Jigsaw
Java 9 Modularity and Project Jigsaw
Comsysto Reply GmbH
 
What's New in Java 9
What's New in Java 9What's New in Java 9
What's New in Java 9
Richard Langlois P. Eng.
 
JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after Modularity
DanHeidinga
 
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
 
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
Java 9: Deep Dive into Modularity and Dealing with Migration IssuesJava 9: Deep Dive into Modularity and Dealing with Migration Issues
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
GlobalLogic Ukraine
 
Java 9 New Features
Java 9 New FeaturesJava 9 New Features
Java 9 New Features
Ali BAKAN
 
Modular Java
Modular JavaModular Java
Modular Java
Martin Toshev
 
Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)
Robert Scholte
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Martin Toshev
 
Java8 - Under the hood
Java8 - Under the hoodJava8 - Under the hood
Java8 - Under the hood
Lakshmi Narasimhan
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
Ryan Cuprak
 
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
 
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Robert Scholte
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module System
Vignesh Ramesh
 
Leaner microservices with Java 10
Leaner microservices with Java 10Leaner microservices with Java 10
Leaner microservices with Java 10
Arto Santala
 
Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1
Kevin Sutter
 
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
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Rikard Thulin
 

Similar to Java 9 / Jigsaw - AJUG/VJUG session (20)

Java 9 Module System
Java 9 Module SystemJava 9 Module System
Java 9 Module System
 
Java9
Java9Java9
Java9
 
Java 9 Modularity and Project Jigsaw
Java 9 Modularity and Project JigsawJava 9 Modularity and Project Jigsaw
Java 9 Modularity and Project Jigsaw
 
What's New in Java 9
What's New in Java 9What's New in Java 9
What's New in Java 9
 
JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after Modularity
 
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)
 
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
Java 9: Deep Dive into Modularity and Dealing with Migration IssuesJava 9: Deep Dive into Modularity and Dealing with Migration Issues
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
 
Java 9 New Features
Java 9 New FeaturesJava 9 New Features
Java 9 New Features
 
Modular Java
Modular JavaModular Java
Modular Java
 
Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
 
Java8 - Under the hood
Java8 - Under the hoodJava8 - Under the hood
Java8 - Under the hood
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
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
 
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module System
 
Leaner microservices with Java 10
Leaner microservices with Java 10Leaner microservices with Java 10
Leaner microservices with Java 10
 
Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1
 
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)
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4
 

More from Mani Sarkar

How to contribute to Adopt OpenJDK?
How to contribute to Adopt OpenJDK?How to contribute to Adopt OpenJDK?
How to contribute to Adopt OpenJDK?
Mani Sarkar
 
Cli in the browser
Cli in the browserCli in the browser
Cli in the browser
Mani Sarkar
 
Theory of constraints
Theory of constraintsTheory of constraints
Theory of constraints
Mani Sarkar
 
Kanban kata
Kanban kataKanban kata
Kanban kata
Mani Sarkar
 
Refactoring developer habits
Refactoring developer habitsRefactoring developer habits
Refactoring developer habits
Mani Sarkar
 
Essential technical skills
Essential technical skillsEssential technical skills
Essential technical skills
Mani Sarkar
 
How is Java / JVM built ? Back then and now...
How is Java / JVM built ? Back then and now...How is Java / JVM built ? Back then and now...
How is Java / JVM built ? Back then and now...
Mani Sarkar
 
How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !
Mani Sarkar
 
Adopt OpenJDK the past, the present & the future
Adopt OpenJDK  the past, the present & the futureAdopt OpenJDK  the past, the present & the future
Adopt OpenJDK the past, the present & the future
Mani Sarkar
 
Adopt OpenJDK presentation (slide deck)
Adopt OpenJDK presentation (slide deck)Adopt OpenJDK presentation (slide deck)
Adopt OpenJDK presentation (slide deck)
Mani Sarkar
 
Adopt OpenJDK, Betterrev blind ignite presentation
Adopt OpenJDK, Betterrev blind ignite presentationAdopt OpenJDK, Betterrev blind ignite presentation
Adopt OpenJDK, Betterrev blind ignite presentation
Mani Sarkar
 
Fosdem2014 fromwebrevtobetterrevbryantsarkar-140203131215-phpapp02
Fosdem2014 fromwebrevtobetterrevbryantsarkar-140203131215-phpapp02Fosdem2014 fromwebrevtobetterrevbryantsarkar-140203131215-phpapp02
Fosdem2014 fromwebrevtobetterrevbryantsarkar-140203131215-phpapp02
Mani Sarkar
 
Java2 days 2013-lambda
Java2 days 2013-lambdaJava2 days 2013-lambda
Java2 days 2013-lambda
Mani Sarkar
 
Ljc conf open jdk betterrev bof
Ljc conf open jdk betterrev bofLjc conf open jdk betterrev bof
Ljc conf open jdk betterrev bof
Mani Sarkar
 
Sonar qube to impove code quality
Sonar qube   to impove code qualitySonar qube   to impove code quality
Sonar qube to impove code quality
Mani Sarkar
 
Java2 days 2013-j-treg
Java2 days 2013-j-tregJava2 days 2013-j-treg
Java2 days 2013-j-treg
Mani Sarkar
 
Leaning on the two Ts
Leaning on the two TsLeaning on the two Ts
Leaning on the two Ts
Mani Sarkar
 

More from Mani Sarkar (17)

How to contribute to Adopt OpenJDK?
How to contribute to Adopt OpenJDK?How to contribute to Adopt OpenJDK?
How to contribute to Adopt OpenJDK?
 
Cli in the browser
Cli in the browserCli in the browser
Cli in the browser
 
Theory of constraints
Theory of constraintsTheory of constraints
Theory of constraints
 
Kanban kata
Kanban kataKanban kata
Kanban kata
 
Refactoring developer habits
Refactoring developer habitsRefactoring developer habits
Refactoring developer habits
 
Essential technical skills
Essential technical skillsEssential technical skills
Essential technical skills
 
How is Java / JVM built ? Back then and now...
How is Java / JVM built ? Back then and now...How is Java / JVM built ? Back then and now...
How is Java / JVM built ? Back then and now...
 
How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !
 
Adopt OpenJDK the past, the present & the future
Adopt OpenJDK  the past, the present & the futureAdopt OpenJDK  the past, the present & the future
Adopt OpenJDK the past, the present & the future
 
Adopt OpenJDK presentation (slide deck)
Adopt OpenJDK presentation (slide deck)Adopt OpenJDK presentation (slide deck)
Adopt OpenJDK presentation (slide deck)
 
Adopt OpenJDK, Betterrev blind ignite presentation
Adopt OpenJDK, Betterrev blind ignite presentationAdopt OpenJDK, Betterrev blind ignite presentation
Adopt OpenJDK, Betterrev blind ignite presentation
 
Fosdem2014 fromwebrevtobetterrevbryantsarkar-140203131215-phpapp02
Fosdem2014 fromwebrevtobetterrevbryantsarkar-140203131215-phpapp02Fosdem2014 fromwebrevtobetterrevbryantsarkar-140203131215-phpapp02
Fosdem2014 fromwebrevtobetterrevbryantsarkar-140203131215-phpapp02
 
Java2 days 2013-lambda
Java2 days 2013-lambdaJava2 days 2013-lambda
Java2 days 2013-lambda
 
Ljc conf open jdk betterrev bof
Ljc conf open jdk betterrev bofLjc conf open jdk betterrev bof
Ljc conf open jdk betterrev bof
 
Sonar qube to impove code quality
Sonar qube   to impove code qualitySonar qube   to impove code quality
Sonar qube to impove code quality
 
Java2 days 2013-j-treg
Java2 days 2013-j-tregJava2 days 2013-j-treg
Java2 days 2013-j-treg
 
Leaning on the two Ts
Leaning on the two TsLeaning on the two Ts
Leaning on the two Ts
 

Recently uploaded

Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
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
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
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
 
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
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
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
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
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
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
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
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
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
 

Recently uploaded (20)

Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
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)
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
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"
 
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
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
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
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
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
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
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...
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
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
 

Java 9 / Jigsaw - AJUG/VJUG session

  • 1. Java 9 / Jigsaw Modularisation & more
  • 3. Hosts - Atlanta JUG Pratik Patel @prpatel Vince May @vincentmayers
  • 5. Agenda - Session 1: Introduction - What is meant by Modularisation in Java 9? - Session 2: JLink - Lunch break: lunch + 10/15 minute optional jigsaw session - Session 3: Migrating non-modular app to Java 9 or JShell - Feedback - Contribution - Resources
  • 6. How to share your (live) feedback with us? Discussion/technical corner, share your thoughts, code snippets, issues, feedback with us while you code away... http://bit.ly/J9HackDay-AJUG-feedback We have left a few issues for you to find, investigate, solve, report to us or the OpenJDK / JDK9 team
  • 7. Setup Is everyone setup, and ready to go? http://bit.ly/J9HackDay-repo You have this link via email / meetup message! Read through till the end of the README.md
  • 8. Session 1: Introduction: Java 9 modularisation 15 minutes
  • 9. What is meant by Modularisation in Java 9? JDK module java.base package java.io class Console ... package java.lang class String ... module java.logging package java.util.logging class FileHandler class LogManager ... module java.sql package java.sql class Connection class SqlData ... Java, the language: split into modules modules... packages... classes...
  • 10. What is meant by Modularisation in Java 9? java.base java.sql other modules... java.logging Java, the language: dependency graph java.xml implicit implicit explicit (requires) explicit (requires) implicit JDK
  • 11. What is meant by Modularisation in Java 9? Java, the language: dependency graph java.base java.sql other modules... java.logging java.xml implicit implicit explicit (requires) explicit (requires) implicit JDK Our Java applications explicit (requires) explicit implicit
  • 12. What is meant by Modularisation in Java 9? Pre-Java 9 Java 9/Jigsaw src/main/java package a.b.c class p class q package m.n.o class s class t src/main/java module a.b.c package a.b.c class p class q module m.n.o package m.n.o class s class t Structure of a typical Java app. containing packages... Create your own modules containing packages, classes...
  • 13. What is meant by Modularisation in Java 9? Typical package structure Modules contain packages Credits to Paul Bakker & Sander Mak package books.api.entities classes package bookstore.api.service What is looks like from the file system?
  • 14. What is meant by Modularisation in Java 9? Typical package structure Modules contain packages Credits to Paul Bakker & Sander Mak contains module visibility (readability) & dependency info module books.api contains package books.api.entities package books.api.service modules What is looks like from the file system?
  • 15. What is meant by Modularisation in Java 9? module com.abc { requires com.abc.pqr; requires transitive com.xyz.abc; exports com.abc.def.alpha; exports com.abc.pqr.beta to com.ijk.mno, com.lmn.stu; uses java.network.Driver; provides java.sql.Driver with com.mno.def.Driver; } module definition defines dependencies of module, to modules com.abc.pqr & com.xyz.abc transitive keyword defines implicit dependency module name How is module dependencies are defined in Java 9? module-info.java
  • 16. What is meant by Modularisation in Java 9? module com.abc { requires com.abc.pqr; requires transitive com.xyz.abc; exports com.abc.def.alpha; exports com.abc.pqr.beta to com.ijk.mno, com.lmn.stu; uses java.network.Driver; provides java.sql.Driver with com.mno.def.Driver; } module definition make all & only public types in specified packages available to other modules How is module dependencies are defined in Java 9? module name … or make available to specified modules module-info.java
  • 17. What is meant by Modularisation in Java 9? module com.abc { requires com.abc.pqr; requires transitive com.xyz.abc; exports com.abc.def.alpha; exports com.abc.pqr.beta to com.ijk.mno, com.lmn.stu; uses java.network.Driver; provides java.sql.Driver with com.mno.def.Driver; } module-info.java module definition this module publishes a service provider this module uses a service provider published by another module module name How is module dependencies are defined in Java 9?
  • 18. Link to all the exercises! http://bit.ly/J9Hackday-exercises
  • 19. Session 1: Hands-on: Java 9 modularisation 60 minutes http://bit.ly/J9HackDay-session-1-jigsaw-intro (http://bit.ly/J9HackDay-repo)
  • 20. Session 1: feedback 15 minutes http://bit.ly/J9HackDay-AJUG-feedback
  • 21. Lunch break 60 minutes Short 10/15 minutes covering intro/background/fundamentals (talk while having a bite of food and drink)
  • 22. What is meant by Modularisation in Java 9? A bit of fundamentals and background before we get to the answer
  • 23. What is meant by Modularisation in Java 9? modularisation Pre-Java 9 Java 9 Anomalies OpenJDK& JDK
  • 24. What is meant by Modularisation in Java 9? How we perceive the JDK/JRE from a developer’s / end-user’s perspective? JDK or JRE IBM Other vendors Oracle download Create Client Apps distribute Client Apps + bundle JRE
  • 25. What is meant by Modularisation in Java 9? How the maintainers of Java perceive it? Distribute built apps + bundle JDK IBM Other vendors Oracle build downloadOpenJDK JDK
  • 26. What is meant by Modularisation in Java 9? Modularisation of OpenJDK sources (JEP 201 and related JEPs) Binary compatible JDK re-organise rebuild OpenJDK source Refactored OpenJDK source Repository JDK re-organise Improved layout of source folders in the JDK repository
  • 27. What is meant by Modularisation in Java 9? Modularisation of Runtime Images (JEP 220 and related JEPs) Binary compatible JDK re-organise rebuild Runtime JDK Optimised (modular) JDK Runtime Traditional Runtime JDK Image re-organise A more compact Runtime JDK Image
  • 28. What is meant by Modularisation in Java 9? Modularisation of Java Packages and Application Packaging (JEP 275 and related JEPs) Modular Java 9 application + custom JDK compiles creates Modularised JDK Runtime Modular Java 9 source JLink Smaller JDK footprint Java 9 applicationcompiles creates Modularised JDK Runtime Non-modular Java 9 source Binary compatible creates
  • 29. What is meant by Modularisation in Java 9? JSR 376: Java Platform Module System played the primary role http://openjdk.java.net/projects/jigsaw/spec/
  • 30. What is meant by Modularisation in Java 9? JEPs that lead to all the new features in Java 9 (including Jigsaw): - 200: The Modular JDK - 201: Modular Source Code - 220: Modular Run-Time Images (depends on JEP 162) - 260: Encapsulate Most Internal APIs (no dependencies) - 261: Module System (dependens on JEP 220, related to JEP 238) - 282: jlink: The Java Linker (replaces implementation of JEP 220) - 275: Modular Java Application Packaging - 222: jshell: The Java Shell (Read-Eval-Print Loop) - 193: Variable Handles - 110: HTTP 2 Client - 238: Multi-Release JAR Files - 158: Unified JVM Logging - G1 related JEPs (3) - JEPs related to a number of security improvements - JEPs related to a number of platform improvements - >>> Many, many more JEPs, see the Java 9 JEPs list for further details <<<
  • 31. What is meant by Modularisation in Java 9? JDK 9& Jigsaw feature distribution ... Other JDK 9 features Jigsaw ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
  • 32. Why Modularisation in Java 9? But, why?
  • 33. It’s been worked on for about a decade: - Reliable Configuration - define module dependencies - resolve classpath issues - Strong Encapsulation - define or hiding away what’s not intended or necessary for public access - JDK internal APIs (sun.misc.unsafe, security, etc…) - within APIs of our own applications Why Modularisation in Java 9?
  • 34. Other side effects and benefits: - Decluttering of code bases (loose coupling & high cohesion) - OpenJDK sources - JDK sources - Our Java App sources (post migration and refactoring) - Customised runtime JDK (smaller footprint) - Highly desirable for IoT, arduino/embedded devices, etc… - Improve distribution and runtime performance - Any more? Why Modularisation in Java 9?
  • 35. Why Modularisation in Java 9? Important Java 9 concepts & terminologies
  • 36. Concepts & terminologies - module - modular JAR - accessibility - implied readability - automatic module - unnamed module - open module - open package - split packages Important Java 9 Concepts & Terminologies Credits: Oleg Tsal-Tsalko & Nicolai Parlog
  • 37. module - named (via module-info.java) - self-describing collection of code and data - declares which other modules it requires - exports one or more packages to other modules Important Java 9 Concepts & Terminologies
  • 38. modular JAR - like any other JAR file - contains module-info.class in its root directory Important Java 9 Concepts & Terminologies
  • 39. accessibility (accessibility of types between modules) - type must be public - module exports the package containing the type - module depending on it declares it as required (requires) Important Java 9 Concepts & Terminologies
  • 40. implied readability (direct & implied readability) Important Java 9 Concepts & Terminologies readsmodule A requires B module B exports ... readsmodule A requires B module B exports … requires C reads module C exports ... module A indirectly reads module C module A directly reads module B
  • 41. automatic module - any (non-modular) JAR file placed on the MODULEPATH - module name is derived from the jar name - can have no module name if compiler fails to derive from the jar name - does not contain the module descriptor file module-info.java - exports everything - reads all modules including unnamed modules - not open for reflective access (unless directives are used) Important Java 9 Concepts & Terminologies
  • 42. named module - modular JAR file placed on the MODULEPATH - module name is derived from the module-info.java descriptor file - exports only packages that are declared exports - reads only modules declared as requires - not open for deep reflective access (unless directives are used) Important Java 9 Concepts & Terminologies
  • 43. unnamed module - any (non-modular) JAR file placed on the CLASSPATH - module name is not derived from the jar name - does not contain module-info.java descriptor file - exports everything - reads all modules except cannot read unnamed modules - open for deep reflective access (for backward compatibility) Important Java 9 Concepts & Terminologies
  • 44. automatic v/s unnamed modules - they are the same, except - automatic module: any (non-modular) JAR file placed on the MODULEPATH - unnamed module: any (non-modular) JAR file placed on the CLASSPATH - automatic modules get their names from the jar, unnamed modules as the name states, is not named Important Java 9 Concepts & Terminologies
  • 45. open module - a module declared for deep reflective access by other modules (to help migration) - declared in the module-info.java Important Java 9 Concepts & Terminologies open module foo.bar { exports com.foo.bar; requires hibernate.core; requires hibernate.entitymanager; } open module
  • 46. open package - a package declared for deep reflective access by other modules (to help migration) - declared in the module-info.java Important Java 9 Concepts & Terminologies module foo.bar { exports com.foo.bar; opens com.foo.bar.model; requires hibernate.core; requires hibernate.entitymanager; } open package
  • 47. split packages - Two or more modules containing the same package results - strictly checked for Java 9 modules (named) - not checked for unnamed modules - causes the package to become invisible Important Java 9 Concepts & Terminologies
  • 48. Not everything can be covered but let’s find out about these topics: - difference between classpath and module path - kill switch (remove Jigsaw restrictions): - java --permit-illegal-access … - Jlink CLI option: --launcher - maven, ant or gradle integrations - and many more topics… - checkout the resources on http://bit.ly/Java-9-Resources So many things to cover!
  • 50. Session 2: Introduction: JLink 10 minutes
  • 51. Session 2: Introduction: JLink Create a package distributable, that runs on any platform, but needs a platform specific JDK JDK (javac) Your App packages & classes Your App package (distributable) JVM, the Platform Java, the language (packages & classes) Any JRE/JDK compiles creates Pre-Java 9 depends on (needs), to run
  • 52. Session 2: Introduction: JLink JDK modules JLink JVM, the Platform Java, the language (JDK modules) Your App modules Create standalone distributable (smaller footprint), that runs on a specific platform Your App modules JDK compiles creates Java 9
  • 53. Session 2: Hands-on: JLink 40 minutes http://bit.ly/J9HackDay-session-2-jlink (http://bit.ly/J9HackDay-repo)
  • 54. Session 2: feedback 10 minutes http://bit.ly/J9HackDay-AJUG-feedback
  • 55. Session 3: Introduction: Migration or JShell 15 minutes
  • 56. Session 3: Introduction: Migration or JShell
  • 57. Session 3 hands-on: Migration or JShell 60 minutes http://bit.ly/J9HackDay-session-3-jshell (http://bit.ly/J9HackDay-repo)
  • 58. Session 3 & overall: feedback 15-30 minutes http://bit.ly/J9HackDay-AJUG-feedback
  • 59. Contribute Don’t like something or like something a lot, want to contribute to make things better? http://bit.ly/AdoptOpenJDK-contribute
  • 60. Feedback We value your feedback, make Java better with your constructive feedback http://bit.ly/AdoptOpenJDK-feedback
  • 61. Resources Want to know about the other features of Java 9: http://bit.ly/Java-9-Resources
  • 62. Thank you to all Thank you for your continued support 9 @atlantajug @virtualJug @adoptopenjdk @openjdk @jcp_org @java