SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante 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
 

Semelhante 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
 

Mais 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
 

Mais 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

Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdfMeon Technology
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesShyamsundar Das
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageDista
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 

Último (20)

Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdf
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security Challenges
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 

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