SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
Java SE 9, Project Jigsaw
Elek Márton
@anzix
2015 March
DPC Consulting
Java 9 roadmap
2015/09/08 Mark Reinhold: The state of the
module system (Java 9 b83)
2015/12/10 Feature Complete
2016/02/04 All Tests Run
2016/02/25 Rampdown Start
2016/04/21 Zero Bug Bounce
2016/06/16 Rampdown Phase 2
2016/07/21 Final Release Candidate
2016/09/22 General Availability
Planned features
Improvements
● Java REPL
● HTTP2 Client
● UTF-8 Property files
● Microbenchmark Suite
● Compiler improvements
● Money and Currency API, JSR-354 (?)
● JSON API (? - proposed to be dropped)
● ProcessAPI update (pid, process list)
● HTML5 Javadoc
● Make G1 the default GC algorithm
● Remove deprecated GC combinations
Modularization
Related JEPs/JSR
JEP 200: The Modular JDK
JEP 201: Modular Source Code
JEP 220: Modular Run-Time Images
JEP 162: Prepare for Modularization (Java8)
JSR 376: Java Platform Module System
Good source:
Mark Reinhold: The state of the module system
Getting started
Create your first module:
● traditional JAR file with
● module-info.java
module hu.dpc.java9.logger {
}
Compile the module
● Could be compiled with standard tools (maven) if
there are no dependencies
● Command line tools are also changed
javac
-d /tmp/modules/hu.dpc.java9.logger
-modulepath /tmp/modules
-sourcepath src/main/java …..java
Using the logger
Create your first module:
● traditional JAR file with
● module-info.java
module hu.dpc.java9.logger {
exports hu.dpc.java9.logger;
}
Using logger
public class App {
public static void main(String[] args)
LoggerFactory.getLogger().log("Hello world");
}
}
module hu.dpc.java9.app {
requires hu.dpc.java9.logger;
}
Package level dependencies
Source: M Reinhold: The state of the
module system
Why we need classloaders?
● Classloader is for creating new classes
● Reference to a class could be used even without
explicit export
LoggerImpl
App
LoggerFactory
Logger
exports
requires
Compile and run
javac
-d /tmp/modules/hu.dpc.java9.logger
-modulepath /tmp/modules
-sourcepath src/main/java ....java
java
-mp /tmp/modules
-m hu.dpc.java9.app/hu.dpc.java9.App
Backward compatibility
java
-mp /tmp/modules
-m hu.dpc.java9.app/hu.dpc.java9.App
java
-cp /tmp/modules/hu.dpc.java9.app:/tmp/modules/hu.dpc.java9.logger
hu.dpc.java9.App
Packaging: jmod
● Accommodate native code, configuration files, and
other kinds of data
● "Whether this new format, provisionally named
“JMOD,” should be standardized is an open
question."
JDK modules
● Most of the APIs
are modularized
● can’t be used
without proper
requires in
module-info
Service layer
Service Layer
logger-framework.jar
logger-mysql.jar
interface Logger{...}
class MysqlLogger{...}
class LoggerFactory{...
Service Layer
logger-framework.jar
logger-syslog.jar
interface Logger{...}
class SyslogLogger{...}
class LoggerFactory{...
Service Layer - Java 6-8
Service Provider Interface
● Which are the implementation of a specific
interface?
ServiceLoader<Logger> loggers =
ServiceLoader.load(Logger.class);
for (Logger logger: loggers) {
logger.log("hello world");
}
}
Service Layer - Java 6-8
ServiceLoader<Logger> loggers =
ServiceLoader.load(Logger.class);
for (Logger logger: loggers) {
logger.log("hello world");
}
}
Definition (in the jar file):
META-INF/services/hu.dpc.java9.logger.Logger
hu.dpc.java9.logger.internal.LoggerImpl
Service Layer - Java 6-8
logger-framework.jar
logger-mysql.jar
interface Logger{...}
class MysqlLogger{...}
class LoggerFactory{...
Service Layer - Java 9
Usage:
ServiceLoader<Logger> loggers =
ServiceLoader.load(Logger.class);
for (Logger logger: loggers) {
logger.log("hello world");
}
}
Definition
In the hu.dpc.java9.logger module:
module hu.dpc.java9.logger {
exports hu.dpc.java9.logger;
provides hu.dpc.java9.logger.Logger
with hu.dpc.java9.logger.internal.LoggerImpl;
}
In the hu.dpc.java9.app module
module hu.dpc.java9.app {
requires hu.dpc.java9.logger;
use hu.dpc.java9.logger.Logger;
}
Non requirements
● Modularize the Java Language Specification
● Modularize the Java Virtual Machine Specification
● Multiple versions
● Version selection
● Strict classloader requirements
See: http://openjdk.java.net/projects/jigsaw/spec/reqs/
Java 9 vs OSGi
Java 9 / Jigsaw OSGi
metadata module-info.java (nincs meta adat) META-INF
classpath
separation
exports/requires Import-Package/Export-Package
classpath++ transitive imports, fragment bundle/dynamic import
classloader
hierarchy
ClassLoader: unspecified strict, per bundle
service layer static (get implementations) dynamic (get implemetations +
start/stop listeners)
services interface + implementation for the standard
services (logging, config...)
versioning no yes
Summary/Future
● Summary
– classpath separation: private/public
– service locator (based on existing SPI)
– modularized JVM APIs
● Not scope
– versioning!
– strict class loader rules
● Shoud be upgraded:
– all the IDEs
– all the build tools (maven, gradle)
– all the JVM based languages (Scala, Clojure)
● SPI
– could be more widely adopted

Weitere ähnliche Inhalte

Was ist angesagt?

Discuss about java 9 with latest features
Discuss about java 9 with latest featuresDiscuss about java 9 with latest features
Discuss about java 9 with latest featuresNexSoftsys
 
Modular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafModular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafIoan Eugen Stan
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVMRyan Cuprak
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applicationsJulien Dubois
 
Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System IntroductionDan Stine
 
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
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerSimon Ritter
 
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
 
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
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Ryan Cuprak
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerSimon Ritter
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9Deepu Xavier
 

Was ist angesagt? (20)

Java 9 preview
Java 9 previewJava 9 preview
Java 9 preview
 
Desiging for Modularity with Java 9
Desiging for Modularity with Java 9Desiging for Modularity with Java 9
Desiging for Modularity with Java 9
 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
 
Modular Java
Modular JavaModular Java
Modular Java
 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
 
Discuss about java 9 with latest features
Discuss about java 9 with latest featuresDiscuss about java 9 with latest features
Discuss about java 9 with latest features
 
Java Modularity: the Year After
Java Modularity: the Year AfterJava Modularity: the Year After
Java Modularity: the Year After
 
Modular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafModular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache Karaf
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012
 
Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System Introduction
 
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)
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
Java 9 and Beyond
Java 9 and BeyondJava 9 and Beyond
Java 9 and Beyond
 
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)
 
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)
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9
 

Andere mochten auch

Andere mochten auch (6)

Full stack security
Full stack securityFull stack security
Full stack security
 
Docker+java
Docker+javaDocker+java
Docker+java
 
Két Java fejlesztő első Scala projektje
Két Java fejlesztő első Scala projektjeKét Java fejlesztő első Scala projektje
Két Java fejlesztő első Scala projektje
 
OSGi in 5 minutes
OSGi in 5 minutesOSGi in 5 minutes
OSGi in 5 minutes
 
Introducing the Jahia Log Analyzer
Introducing the Jahia Log AnalyzerIntroducing the Jahia Log Analyzer
Introducing the Jahia Log Analyzer
 
Provisioning the IoT
Provisioning the IoTProvisioning the IoT
Provisioning the IoT
 

Ähnlich wie Java 9 and Project Jigsaw

Java 9-10 What's New
Java 9-10 What's NewJava 9-10 What's New
Java 9-10 What's NewNicola Pedot
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youDmitry Buzdin
 
Jozi-JUG JDK 9 Unconference
Jozi-JUG JDK 9 UnconferenceJozi-JUG JDK 9 Unconference
Jozi-JUG JDK 9 UnconferenceHeather VanCura
 
Java and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemJava and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemRafael Winterhalter
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023VMware Tanzu
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiSoftware Guru
 
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]Leonardo Zanivan
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Rikard Thulin
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware Tanzu
 
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzioneJava 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzioneThinkOpen
 
Java 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgradeJava 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgradeSimone Bordet
 
Java 22_ Unwrapped: What You Need to Know.pptx
Java 22_ Unwrapped: What You Need to Know.pptxJava 22_ Unwrapped: What You Need to Know.pptx
Java 22_ Unwrapped: What You Need to Know.pptxOleh Melnyk
 
コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!Takahiro Itagaki
 
JCConf 2018 - Retrospect and Prospect of Java
JCConf 2018 - Retrospect and Prospect of JavaJCConf 2018 - Retrospect and Prospect of Java
JCConf 2018 - Retrospect and Prospect of JavaJoseph Kuo
 
Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12Rory Preddy
 
JDD2015: Taste of new in Java 9 - Arkadiusz Sokołowski
JDD2015: Taste of new in Java 9 - Arkadiusz SokołowskiJDD2015: Taste of new in Java 9 - Arkadiusz Sokołowski
JDD2015: Taste of new in Java 9 - Arkadiusz SokołowskiPROIDEA
 

Ähnlich wie Java 9 and Project Jigsaw (20)

Java 9-10 What's New
Java 9-10 What's NewJava 9-10 What's New
Java 9-10 What's New
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for you
 
Java 9 sneak peek
Java 9 sneak peekJava 9 sneak peek
Java 9 sneak peek
 
Jozi-JUG JDK 9 Unconference
Jozi-JUG JDK 9 UnconferenceJozi-JUG JDK 9 Unconference
Jozi-JUG JDK 9 Unconference
 
Java and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemJava and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystem
 
Retour JavaOne 2009
Retour JavaOne 2009Retour JavaOne 2009
Retour JavaOne 2009
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
 
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
 
Grails 101
Grails 101Grails 101
Grails 101
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzioneJava 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
 
Java 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgradeJava 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgrade
 
AMIS Oracle OpenWorld 2013 Review Part 3 - Fusion Middleware
AMIS Oracle OpenWorld 2013 Review Part 3 - Fusion MiddlewareAMIS Oracle OpenWorld 2013 Review Part 3 - Fusion Middleware
AMIS Oracle OpenWorld 2013 Review Part 3 - Fusion Middleware
 
Java 22_ Unwrapped: What You Need to Know.pptx
Java 22_ Unwrapped: What You Need to Know.pptxJava 22_ Unwrapped: What You Need to Know.pptx
Java 22_ Unwrapped: What You Need to Know.pptx
 
コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!
 
JCConf 2018 - Retrospect and Prospect of Java
JCConf 2018 - Retrospect and Prospect of JavaJCConf 2018 - Retrospect and Prospect of Java
JCConf 2018 - Retrospect and Prospect of Java
 
Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12
 
JDD2015: Taste of new in Java 9 - Arkadiusz Sokołowski
JDD2015: Taste of new in Java 9 - Arkadiusz SokołowskiJDD2015: Taste of new in Java 9 - Arkadiusz Sokołowski
JDD2015: Taste of new in Java 9 - Arkadiusz Sokołowski
 

Mehr von DPC Consulting Ltd

Mehr von DPC Consulting Ltd (7)

Scaling on AWS
Scaling on AWSScaling on AWS
Scaling on AWS
 
Jsonp coding dojo
Jsonp coding dojoJsonp coding dojo
Jsonp coding dojo
 
Microservices and modularity with java
Microservices and modularity with javaMicroservices and modularity with java
Microservices and modularity with java
 
Garbage First Garbage Collector Algorithm
Garbage First Garbage Collector AlgorithmGarbage First Garbage Collector Algorithm
Garbage First Garbage Collector Algorithm
 
Power tools in Java
Power tools in JavaPower tools in Java
Power tools in Java
 
Server in your Client
Server in your ClientServer in your Client
Server in your Client
 
OSGi as Enterprise Integration Platform
OSGi as Enterprise Integration PlatformOSGi as Enterprise Integration Platform
OSGi as Enterprise Integration Platform
 

Kürzlich hochgeladen

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Kürzlich hochgeladen (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Java 9 and Project Jigsaw

  • 1. Java SE 9, Project Jigsaw Elek Márton @anzix 2015 March DPC Consulting
  • 2. Java 9 roadmap 2015/09/08 Mark Reinhold: The state of the module system (Java 9 b83) 2015/12/10 Feature Complete 2016/02/04 All Tests Run 2016/02/25 Rampdown Start 2016/04/21 Zero Bug Bounce 2016/06/16 Rampdown Phase 2 2016/07/21 Final Release Candidate 2016/09/22 General Availability
  • 4. Improvements ● Java REPL ● HTTP2 Client ● UTF-8 Property files ● Microbenchmark Suite ● Compiler improvements ● Money and Currency API, JSR-354 (?) ● JSON API (? - proposed to be dropped) ● ProcessAPI update (pid, process list) ● HTML5 Javadoc ● Make G1 the default GC algorithm ● Remove deprecated GC combinations
  • 6. Related JEPs/JSR JEP 200: The Modular JDK JEP 201: Modular Source Code JEP 220: Modular Run-Time Images JEP 162: Prepare for Modularization (Java8) JSR 376: Java Platform Module System Good source: Mark Reinhold: The state of the module system
  • 7. Getting started Create your first module: ● traditional JAR file with ● module-info.java module hu.dpc.java9.logger { }
  • 8. Compile the module ● Could be compiled with standard tools (maven) if there are no dependencies ● Command line tools are also changed javac -d /tmp/modules/hu.dpc.java9.logger -modulepath /tmp/modules -sourcepath src/main/java …..java
  • 9. Using the logger Create your first module: ● traditional JAR file with ● module-info.java module hu.dpc.java9.logger { exports hu.dpc.java9.logger; }
  • 10. Using logger public class App { public static void main(String[] args) LoggerFactory.getLogger().log("Hello world"); } } module hu.dpc.java9.app { requires hu.dpc.java9.logger; }
  • 11. Package level dependencies Source: M Reinhold: The state of the module system
  • 12. Why we need classloaders? ● Classloader is for creating new classes ● Reference to a class could be used even without explicit export LoggerImpl App LoggerFactory Logger exports requires
  • 13. Compile and run javac -d /tmp/modules/hu.dpc.java9.logger -modulepath /tmp/modules -sourcepath src/main/java ....java java -mp /tmp/modules -m hu.dpc.java9.app/hu.dpc.java9.App
  • 14. Backward compatibility java -mp /tmp/modules -m hu.dpc.java9.app/hu.dpc.java9.App java -cp /tmp/modules/hu.dpc.java9.app:/tmp/modules/hu.dpc.java9.logger hu.dpc.java9.App
  • 15. Packaging: jmod ● Accommodate native code, configuration files, and other kinds of data ● "Whether this new format, provisionally named “JMOD,” should be standardized is an open question."
  • 16. JDK modules ● Most of the APIs are modularized ● can’t be used without proper requires in module-info
  • 20. Service Layer - Java 6-8 Service Provider Interface ● Which are the implementation of a specific interface? ServiceLoader<Logger> loggers = ServiceLoader.load(Logger.class); for (Logger logger: loggers) { logger.log("hello world"); } }
  • 21. Service Layer - Java 6-8 ServiceLoader<Logger> loggers = ServiceLoader.load(Logger.class); for (Logger logger: loggers) { logger.log("hello world"); } } Definition (in the jar file): META-INF/services/hu.dpc.java9.logger.Logger hu.dpc.java9.logger.internal.LoggerImpl
  • 22. Service Layer - Java 6-8 logger-framework.jar logger-mysql.jar interface Logger{...} class MysqlLogger{...} class LoggerFactory{...
  • 23. Service Layer - Java 9 Usage: ServiceLoader<Logger> loggers = ServiceLoader.load(Logger.class); for (Logger logger: loggers) { logger.log("hello world"); } }
  • 24. Definition In the hu.dpc.java9.logger module: module hu.dpc.java9.logger { exports hu.dpc.java9.logger; provides hu.dpc.java9.logger.Logger with hu.dpc.java9.logger.internal.LoggerImpl; } In the hu.dpc.java9.app module module hu.dpc.java9.app { requires hu.dpc.java9.logger; use hu.dpc.java9.logger.Logger; }
  • 25. Non requirements ● Modularize the Java Language Specification ● Modularize the Java Virtual Machine Specification ● Multiple versions ● Version selection ● Strict classloader requirements See: http://openjdk.java.net/projects/jigsaw/spec/reqs/
  • 26. Java 9 vs OSGi Java 9 / Jigsaw OSGi metadata module-info.java (nincs meta adat) META-INF classpath separation exports/requires Import-Package/Export-Package classpath++ transitive imports, fragment bundle/dynamic import classloader hierarchy ClassLoader: unspecified strict, per bundle service layer static (get implementations) dynamic (get implemetations + start/stop listeners) services interface + implementation for the standard services (logging, config...) versioning no yes
  • 27. Summary/Future ● Summary – classpath separation: private/public – service locator (based on existing SPI) – modularized JVM APIs ● Not scope – versioning! – strict class loader rules ● Shoud be upgraded: – all the IDEs – all the build tools (maven, gradle) – all the JVM based languages (Scala, Clojure) ● SPI – could be more widely adopted