SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
JAVA 9 JIGSAW HACK DAY
JAVA 9 JIGSAW
HACK DAY
Oleg Tsal-Tsalko
JUG Kyiv 2017
@Oleg Tsal-Tsalko JUG Kyiv 2017
SOLUTION ARCHITECT AT EPAM SYSTEMS.
PATIONATE DEVELOPER, SPEAKER, ACTIVE MEMBER OF
KIEV JUG.
PARTICIPATE IN DIFFERENT EDUCATIONAL INITIATIVES,
ENGINEERING EVENTS AND JCP/ADOPTJSR PROGRAMS.
OLEG TSAL-TSALKO
ABOUT ME
CONFIDENTIAL 3
TBFD Agenda
•Intro into Java 9 Module System (~1h)
•VJUG Hacking Session replay hands-on labs (~2h)
•Launch (~30min)
•JUnit 5 platform migration case study (~3h)
CONFIDENTIAL 4
TBFD Expectations
• It’s not an ultimate guide to Modules System. Our goal is to understand what it is
and try to use it.
• We gonna touch only key aspects of Java Module System that will influence most
of the developers.
• You not gonna write Java code))
• We not gonna touch Maven/Gradle integration with Java 9 Modules System.
• Java 9 is not ready to be used on Production yet!
• I’m not an expert))
CONFIDENTIAL 5
TBFD Links and Materials
• https://github.com/olegts/jdk9-jigsaw/tree/jug - VJUG hacking session materials
• https://github.com/olegts/junit5/tree/hackday - JUnit 5 modularizing
• https://docs.google.com/document/d/
11JxkGH4Em0thovKojITM1oHvi9UmFsdtFw3zDRAKeFQ/edit?usp=sharing - Feedback
form
• https://www.slideshare.net/olegtsaltsalko9/java-9-jigsaw-hackday - Slides link
• http://openjdk.java.net/projects/jigsaw/quick-start - Jigsaw quick start guide
• http://jdk.java.net/jigsaw/ - Java 9 Jigsaw early access build download
• http://junit.org/junit5/docs/current/user-guide/#dependency-diagram - JUnit 5
documentation
• https://www.jetbrains.com/help/idea/2017.1/getting-started-with-java-9-module-
system.html - IntelliJ IDEA Java 9 support
CONFIDENTIAL 6
Why do we need Module System?
CONFIDENTIAL 7
CONFIDENTIAL 8
“are these even the correct JARs?”
“are these all required JARs?”
“are there conflicts?”
“are only public APIs used?”
CONFIDENTIAL 9
CONFIDENTIAL 10
As described in the JSR, the specific goals of the
module system are to provide
• Reliable configuration, to replace the brittle,
error-prone class-path mechanism with a means
for program components to declare explicit
dependences upon one another, along with
• Strong encapsulation, to allow a component to
declare which of its public types are accessible
to other components, and which are not.
Goals
CONFIDENTIAL 11
A module is a named, self-describing collection of
code and data. Its code is organized as a set of
packages containing types, i.e., Java classes and
interfaces; its data includes resources and other
kinds of static information. To control how its code
refers to types in other modules, a module
declares which other modules it requires in order
to be compiled and run. To control how code in
other modules refers to types in its packages, a
module declares which of those packages it
exports.
What is module?
CONFIDENTIAL 12
What is modular JAR?
A modular JAR file is like an ordinary JAR
file in all possible ways, except that it also
includes a module-info.class file in its root
directory.
CONFIDENTIAL 13
CONFIDENTIAL 14
CONFIDENTIAL 15
CONFIDENTIAL 16
A type in one module is only accessible by
code in another module if:
• the type is public
• the containing package is exported by the
first module
• the second module reads the first
Accessibility
CONFIDENTIAL 17
Implied readability
CONFIDENTIAL 18
Services
• It’s been around for long time
• Allows loose coupling between Service Providers and Service Consumers
• Services resolved and wired by modular runtime
• ServiceLoader API enhanced
• It’s not a DI
CONFIDENTIAL 19
JDK 7 modules
CONFIDENTIAL 20
JDK 9 modules
CONFIDENTIAL 21
Unnamed module
All JARs left on classpath included in so-called
unnamed module
Rules:
• Exports everything
• Reads all other modules
• Named modules can’t read it
CONFIDENTIAL 22
Bottom-up migration
CONFIDENTIAL 23
Automatic module
Any JAR placed on module path…
Rules:
• Module name derived from JAR name
• Exports everything
• Reads all other modules including unnamed
module
CONFIDENTIAL 24
Top-down migration
CONFIDENTIAL 25
Modules universe
Application’s universe of observable modules can consist of:
•named platform modules as they are contained in the run
time
•one named application module for each artifact on the
module path that has a module descriptor
•one automatic module for each artifact on the module path
that does not have a module descriptor
•a unique unnamed module composed of all artifacts on
the classpath, regardless of whether they have module
descriptors or not (with several application class loaders
there would be several unnamed modules)
CONFIDENTIAL 26
CONFIDENTIAL 27
CONFIDENTIAL 28
Compile
javac --module-path mods 
-d mods/com.greetings 
src/com.greetings/module-info.java 
src/com.greetings/com/greetings/Main.java
javac -d mods 
--module-source-path src $(find . -name "*.java")
CONFIDENTIAL 29
Package
jar --create 
--file mlib/org.astro@1.0.jar 
--module-version 1.0 
-C mods/org.astro .
jar --create 
--file mlib/com.greetings.jar 
--main-class=com.greetings.Main 
-C mods/com.greetings .
CONFIDENTIAL 30
Run
java --module-path mods 
--module com.greetings/com.greetings.Main
java -p mods 
-m com.greetings/com.greetings.Main
java --module-path mlib 
--module com.greetings
CONFIDENTIAL 31
Compose (JLink)
jlink --module-path ${JAVA_HOME}/jmods:mlib 
--add-modules com.greetings 
--output executable
executable/bin/java --module com.greetings
com.greetings.Main

Más contenido relacionado

La actualidad más candente

Framework Modularity Layer - Glyn Normington, IBM
Framework Modularity Layer - Glyn Normington, IBMFramework Modularity Layer - Glyn Normington, IBM
Framework Modularity Layer - Glyn Normington, IBMmfrancis
 
Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System IntroductionDan Stine
 
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Miles Sabin
 
The evolution of OpenJDK: From Java's beginnings to 2014
The evolution of OpenJDK: From Java's beginnings to 2014The evolution of OpenJDK: From Java's beginnings to 2014
The evolution of OpenJDK: From Java's beginnings to 2014Azul Systems Inc.
 
Magnolia Groovy Integration
Magnolia Groovy IntegrationMagnolia Groovy Integration
Magnolia Groovy IntegrationFederico Grilli
 
Disco API - OpenJDK distributions as a service
Disco API - OpenJDK distributions as a serviceDisco API - OpenJDK distributions as a service
Disco API - OpenJDK distributions as a serviceGerrit Grunwald
 
look inside your (Liferay) portal
look inside your (Liferay) portallook inside your (Liferay) portal
look inside your (Liferay) portalIBACZ
 
Projects in Enterprise Java (Java EE)
Projects in Enterprise Java (Java EE)Projects in Enterprise Java (Java EE)
Projects in Enterprise Java (Java EE)Sam Dias
 
[Android] DI in multimodule application
[Android] DI in multimodule application[Android] DI in multimodule application
[Android] DI in multimodule applicationOleg Mazhukin
 
MyFaces Universe at ApacheCon
MyFaces Universe at ApacheConMyFaces Universe at ApacheCon
MyFaces Universe at ApacheConos890
 
What's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xWhat's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xGeertjan Wielenga
 

La actualidad más candente (19)

Framework Modularity Layer - Glyn Normington, IBM
Framework Modularity Layer - Glyn Normington, IBMFramework Modularity Layer - Glyn Normington, IBM
Framework Modularity Layer - Glyn Normington, IBM
 
Practical OSGi
Practical OSGiPractical OSGi
Practical OSGi
 
Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System Introduction
 
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
 
The evolution of OpenJDK: From Java's beginnings to 2014
The evolution of OpenJDK: From Java's beginnings to 2014The evolution of OpenJDK: From Java's beginnings to 2014
The evolution of OpenJDK: From Java's beginnings to 2014
 
VocBench 2.0: A Web Application for Collaborative Development of Multilingual...
VocBench 2.0: A Web Application for Collaborative Development of Multilingual...VocBench 2.0: A Web Application for Collaborative Development of Multilingual...
VocBench 2.0: A Web Application for Collaborative Development of Multilingual...
 
Magnolia Groovy Integration
Magnolia Groovy IntegrationMagnolia Groovy Integration
Magnolia Groovy Integration
 
Disco API - OpenJDK distributions as a service
Disco API - OpenJDK distributions as a serviceDisco API - OpenJDK distributions as a service
Disco API - OpenJDK distributions as a service
 
look inside your (Liferay) portal
look inside your (Liferay) portallook inside your (Liferay) portal
look inside your (Liferay) portal
 
Java modules
Java modulesJava modules
Java modules
 
Projects in Enterprise Java (Java EE)
Projects in Enterprise Java (Java EE)Projects in Enterprise Java (Java EE)
Projects in Enterprise Java (Java EE)
 
[Android] DI in multimodule application
[Android] DI in multimodule application[Android] DI in multimodule application
[Android] DI in multimodule application
 
Learn Java Part 1
Learn Java Part 1Learn Java Part 1
Learn Java Part 1
 
History of java'
History of java'History of java'
History of java'
 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
 
Java 1
Java 1Java 1
Java 1
 
Java Modularity: the Year After
Java Modularity: the Year AfterJava Modularity: the Year After
Java Modularity: the Year After
 
MyFaces Universe at ApacheCon
MyFaces Universe at ApacheConMyFaces Universe at ApacheCon
MyFaces Universe at ApacheCon
 
What's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xWhat's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.x
 

Similar a Java 9 Jigsaw HackDay

Java modulesystem
Java modulesystemJava modulesystem
Java modulesystemMarc Kassis
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Martin Toshev
 
Java 9 / Jigsaw - AJUG/VJUG session
Java 9 / Jigsaw - AJUG/VJUG  sessionJava 9 / Jigsaw - AJUG/VJUG  session
Java 9 / Jigsaw - AJUG/VJUG sessionMani Sarkar
 
Java 9 New Features
Java 9 New FeaturesJava 9 New Features
Java 9 New FeaturesAli BAKAN
 
A Journey through the JDKs (Java 9 to Java 11)
A Journey through the JDKs (Java 9 to Java 11)A Journey through the JDKs (Java 9 to Java 11)
A Journey through the JDKs (Java 9 to Java 11)Markus Günther
 
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
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkHùng Nguyễn Huy
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules uploadRyan Cuprak
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)David Bosschaert
 
Java 9 modularity+
Java 9 modularity+Java 9 modularity+
Java 9 modularity+Ivelin Yanev
 
OSGi in Action Chapter 1 and 2
OSGi in Action Chapter 1 and 2OSGi in Action Chapter 1 and 2
OSGi in Action Chapter 1 and 2pjhInovex
 
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 SystemTim Ellison
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module SystemVignesh Ramesh
 
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 IssuesGlobalLogic Ukraine
 
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
 
Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Java 9 / Jigsaw - LJC / VJUG session (hackday session)Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Java 9 / Jigsaw - LJC / VJUG session (hackday session)Mani Sarkar
 

Similar a Java 9 Jigsaw HackDay (20)

Java modulesystem
Java modulesystemJava modulesystem
Java modulesystem
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
 
Java 9 / Jigsaw - AJUG/VJUG session
Java 9 / Jigsaw - AJUG/VJUG  sessionJava 9 / Jigsaw - AJUG/VJUG  session
Java 9 / Jigsaw - AJUG/VJUG session
 
Java 9 New Features
Java 9 New FeaturesJava 9 New Features
Java 9 New Features
 
A Journey through the JDKs (Java 9 to Java 11)
A Journey through the JDKs (Java 9 to Java 11)A Journey through the JDKs (Java 9 to Java 11)
A Journey through the JDKs (Java 9 to Java 11)
 
Java 9, JShell, and Modularity
Java 9, JShell, and ModularityJava 9, JShell, and Modularity
Java 9, JShell, and Modularity
 
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/)
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)
 
Java 9 modularity+
Java 9 modularity+Java 9 modularity+
Java 9 modularity+
 
OSGi in Action Chapter 1 and 2
OSGi in Action Chapter 1 and 2OSGi in Action Chapter 1 and 2
OSGi in Action Chapter 1 and 2
 
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 Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module System
 
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
 
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)
 
JavaScript Module Loaders
JavaScript Module LoadersJavaScript Module Loaders
JavaScript Module Loaders
 
Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Java 9 / Jigsaw - LJC / VJUG session (hackday session)Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Java 9 / Jigsaw - LJC / VJUG session (hackday session)
 
JavaFX in Action Part I
JavaFX in Action Part IJavaFX in Action Part I
JavaFX in Action Part I
 
Spring framework
Spring frameworkSpring framework
Spring framework
 

Más de Oleg Tsal-Tsalko

Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Oleg Tsal-Tsalko
 
From Streams to Reactive Streams
From Streams to Reactive StreamsFrom Streams to Reactive Streams
From Streams to Reactive StreamsOleg Tsal-Tsalko
 
JUG UA AdoptJSR participation
JUG UA AdoptJSR participationJUG UA AdoptJSR participation
JUG UA AdoptJSR participationOleg Tsal-Tsalko
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Oleg Tsal-Tsalko
 
Java 8 date & time javaday2014
Java 8 date & time javaday2014Java 8 date & time javaday2014
Java 8 date & time javaday2014Oleg Tsal-Tsalko
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration PatternsOleg Tsal-Tsalko
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rulesOleg Tsal-Tsalko
 
JUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programJUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programOleg Tsal-Tsalko
 

Más de Oleg Tsal-Tsalko (14)

Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)
 
Developer on a mission
Developer on a missionDeveloper on a mission
Developer on a mission
 
From Streams to Reactive Streams
From Streams to Reactive StreamsFrom Streams to Reactive Streams
From Streams to Reactive Streams
 
JUG UA AdoptJSR participation
JUG UA AdoptJSR participationJUG UA AdoptJSR participation
JUG UA AdoptJSR participation
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Lambdas HOL
Lambdas HOLLambdas HOL
Lambdas HOL
 
Java 8 date & time javaday2014
Java 8 date & time javaday2014Java 8 date & time javaday2014
Java 8 date & time javaday2014
 
Java 8 date & time
Java 8 date & timeJava 8 date & time
Java 8 date & time
 
Get ready for spring 4
Get ready for spring 4Get ready for spring 4
Get ready for spring 4
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration Patterns
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rules
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
 
JUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programJUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR program
 

Último

Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 

Último (20)

Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 

Java 9 Jigsaw HackDay

  • 1. JAVA 9 JIGSAW HACK DAY JAVA 9 JIGSAW HACK DAY Oleg Tsal-Tsalko JUG Kyiv 2017 @Oleg Tsal-Tsalko JUG Kyiv 2017
  • 2. SOLUTION ARCHITECT AT EPAM SYSTEMS. PATIONATE DEVELOPER, SPEAKER, ACTIVE MEMBER OF KIEV JUG. PARTICIPATE IN DIFFERENT EDUCATIONAL INITIATIVES, ENGINEERING EVENTS AND JCP/ADOPTJSR PROGRAMS. OLEG TSAL-TSALKO ABOUT ME
  • 3. CONFIDENTIAL 3 TBFD Agenda •Intro into Java 9 Module System (~1h) •VJUG Hacking Session replay hands-on labs (~2h) •Launch (~30min) •JUnit 5 platform migration case study (~3h)
  • 4. CONFIDENTIAL 4 TBFD Expectations • It’s not an ultimate guide to Modules System. Our goal is to understand what it is and try to use it. • We gonna touch only key aspects of Java Module System that will influence most of the developers. • You not gonna write Java code)) • We not gonna touch Maven/Gradle integration with Java 9 Modules System. • Java 9 is not ready to be used on Production yet! • I’m not an expert))
  • 5. CONFIDENTIAL 5 TBFD Links and Materials • https://github.com/olegts/jdk9-jigsaw/tree/jug - VJUG hacking session materials • https://github.com/olegts/junit5/tree/hackday - JUnit 5 modularizing • https://docs.google.com/document/d/ 11JxkGH4Em0thovKojITM1oHvi9UmFsdtFw3zDRAKeFQ/edit?usp=sharing - Feedback form • https://www.slideshare.net/olegtsaltsalko9/java-9-jigsaw-hackday - Slides link • http://openjdk.java.net/projects/jigsaw/quick-start - Jigsaw quick start guide • http://jdk.java.net/jigsaw/ - Java 9 Jigsaw early access build download • http://junit.org/junit5/docs/current/user-guide/#dependency-diagram - JUnit 5 documentation • https://www.jetbrains.com/help/idea/2017.1/getting-started-with-java-9-module- system.html - IntelliJ IDEA Java 9 support
  • 6. CONFIDENTIAL 6 Why do we need Module System?
  • 8. CONFIDENTIAL 8 “are these even the correct JARs?” “are these all required JARs?” “are there conflicts?” “are only public APIs used?”
  • 10. CONFIDENTIAL 10 As described in the JSR, the specific goals of the module system are to provide • Reliable configuration, to replace the brittle, error-prone class-path mechanism with a means for program components to declare explicit dependences upon one another, along with • Strong encapsulation, to allow a component to declare which of its public types are accessible to other components, and which are not. Goals
  • 11. CONFIDENTIAL 11 A module is a named, self-describing collection of code and data. Its code is organized as a set of packages containing types, i.e., Java classes and interfaces; its data includes resources and other kinds of static information. To control how its code refers to types in other modules, a module declares which other modules it requires in order to be compiled and run. To control how code in other modules refers to types in its packages, a module declares which of those packages it exports. What is module?
  • 12. CONFIDENTIAL 12 What is modular JAR? A modular JAR file is like an ordinary JAR file in all possible ways, except that it also includes a module-info.class file in its root directory.
  • 16. CONFIDENTIAL 16 A type in one module is only accessible by code in another module if: • the type is public • the containing package is exported by the first module • the second module reads the first Accessibility
  • 18. CONFIDENTIAL 18 Services • It’s been around for long time • Allows loose coupling between Service Providers and Service Consumers • Services resolved and wired by modular runtime • ServiceLoader API enhanced • It’s not a DI
  • 21. CONFIDENTIAL 21 Unnamed module All JARs left on classpath included in so-called unnamed module Rules: • Exports everything • Reads all other modules • Named modules can’t read it
  • 23. CONFIDENTIAL 23 Automatic module Any JAR placed on module path… Rules: • Module name derived from JAR name • Exports everything • Reads all other modules including unnamed module
  • 25. CONFIDENTIAL 25 Modules universe Application’s universe of observable modules can consist of: •named platform modules as they are contained in the run time •one named application module for each artifact on the module path that has a module descriptor •one automatic module for each artifact on the module path that does not have a module descriptor •a unique unnamed module composed of all artifacts on the classpath, regardless of whether they have module descriptors or not (with several application class loaders there would be several unnamed modules)
  • 28. CONFIDENTIAL 28 Compile javac --module-path mods -d mods/com.greetings src/com.greetings/module-info.java src/com.greetings/com/greetings/Main.java javac -d mods --module-source-path src $(find . -name "*.java")
  • 29. CONFIDENTIAL 29 Package jar --create --file mlib/org.astro@1.0.jar --module-version 1.0 -C mods/org.astro . jar --create --file mlib/com.greetings.jar --main-class=com.greetings.Main -C mods/com.greetings .
  • 30. CONFIDENTIAL 30 Run java --module-path mods --module com.greetings/com.greetings.Main java -p mods -m com.greetings/com.greetings.Main java --module-path mlib --module com.greetings
  • 31. CONFIDENTIAL 31 Compose (JLink) jlink --module-path ${JAVA_HOME}/jmods:mlib --add-modules com.greetings --output executable executable/bin/java --module com.greetings com.greetings.Main