SlideShare une entreprise Scribd logo
1  sur  35
© Copyright Azul Systems 2017
© Copyright Azul Systems 2015
@speakjava
JDK 9: Mission Accomplished
What Next For Java?
Simon Ritter
Deputy CTO, Azul Systems
1
© Copyright Azul Systems 2017
JDK 9
© Copyright Azul Systems 2017
JDK 9: Big And Small Changes
3
© Copyright Azul Systems 2017
Java Platform Module System
 The core Java libraries are now a set of modules
– 97 modules for JDK, 28 of which are Java SE
– No more rt.jar or tools.jar files
 Most internal APIs are now encapsulated
– sun.misc.Unsafe, etc.
– Numerous libraries and frameworks use internal APIs
 Module path used to locate modules
– Separate and distinct from classpath
4
© Copyright Azul Systems 2017
JDK 9 And Compatibility
5
"Clean applications that just depend on java.se
should just work" - Oracle
The java.se.ee module is not included on the
modulepath for javac or the JVM by default
© Copyright Azul Systems 2017
JPMS And Existing Applications
 Initially, leave everything on the classpath
 Anything on the classpath is in the unnamed module
– All packages are exported
– The unnamed module depends on all modules
 Migrate to modules as required
– Try automatic modules
– Move existing jar files from classpath to modulepath
6
© Copyright Azul Systems 2017
Breaking Encapsulation
 "The Big Kill Switch" to turn off encapsulation
– --illegal-access
 permit: Warning for first use of an encapsulated API
 warn: Warning for every use of an encapsulated API
 debug: Warning and stack trace for every use
 deny: No access to encapsulated APIs
7
© Copyright Azul Systems 2017
Breaking Encapsulation
 Allowing direct access to encapsulated APIs
– --add-exports
 Allowing reflective access to encapsulated APIs
– --add-opens
8
--add-exports java.management/com.sun.jmx.remote.internal=mytest
--add-exports java.management/sun.management=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
© Copyright Azul Systems 2017
jlink: The Java Linker (JEP 282)
9
Modular run-time
image
…confbin
jlink
$ jlink --modulepath $JDKMODS 
--addmods java.base –output myimage
$ myimage/bin/java –-list-modules
java.base@9
jmods
© Copyright Azul Systems 2017
jlink: The Java Linker (JEP 282)
$ jlink --module-path $JDKMODS:$MYMODS 
--addmods com.azul.app –-output myimage
$ myimage/bin/java –-list-modules
java.base@9
java.logging@9
java.sql@9
java.xml@9
com.azul.app@1.0
com.azul.zoop@1.0
com.azul.zeta@1.0
© Copyright Azul Systems 2017
The Implications Of jlink
 "Write once, run anywhere"
– Long term Java slogan, mainly held true
 jlink generated runtime may not include all Java SE
modules
– But is still a conformant Java implementation
– To be conformant:
 It must include the java.base module
 If other modules are included, all transitive module dependencies
must also be included
– Defined as a closed implementation
© Copyright Azul Systems 2017
JDK Development Changes
© Copyright Azul Systems 2017
OpenJDK: New Release Model
 A new version of the JDK will be released every six months
– March and September
– Starting next year
 OpenJDK development will be more agile
– Previous target was a release every two years
 Three and a half years between JDK 8 and JDK 9
 Features will be included only when ready
– Targeted for a release when feature complete
– Not targeted at specific release when started
13
© Copyright Azul Systems 2017
OpenJDK: More Open Source
 Oracle will open-source closed-source parts of the JDK
– Flight recorder
– Mission control
 The goal is for there to be no functional difference between
an Oracle binary and a binary built from OpenJDK source
– Targeted for completion late 2018
14
© Copyright Azul Systems 2017
JDK Version Numbering
 New scheme introduced in JDK 9 (JEP 223)
– JDK ${MAJOR}.${MINOR}.${SECURITY}
– Semantic versioning
– Easier to understand by humans and computers
15
© Copyright Azul Systems 2017
JDK Version Numbering
 New proposal for subsequent releases
– JDK ${YEAR}.${MONTH}
 JDK 18.3, JDK 18.9, etc.
– Same concept as used by Ubuntu
– Many people not happy about this
16
© Copyright Azul Systems 2017
JDK Version Numbering
 New, new scheme. Just proposed
– $FEATURE.$INTERIM.$UPDATE.$EMERG
– FEATURE: Was MAJOR, i.e. 10, 11, etc.
– INTERIM: Was MINOR. Reserved for future use
– UPDATE: Was SECURITY, but with different incrementing rule
– EMERG: Emergency update outside planned schedule
17
© Copyright Azul Systems 2017
Availability Of JDK Updates
 Oracle are switching to a long term support (LTS) model
 LTS release will have 3 years of public updates
– JDK 8 has been classified as an LTS release
 It will have updates for more than 3 years
– Next LTS release will be September, 2018
 Non-LTS releases are "Feature Releases"
– JDK 9 is a feature release
– Public updates only until next feature release
 JDK 9 public updates end in March, 2018
18
© Copyright Azul Systems 2017
Deprecated in JDK 9: Soon To Go
 Applets as a deployment mechanism
 CMS garbage collector
 Java policy tool, jconsole, Doclet API, other small things
 java.se.ee meta-module
 java.corba
 java.transaction
 java.activation
 java.xml.bind
 java.xml.ws
 java.xml.ws.annotation
19
© Copyright Azul Systems 2017
Oracle Binaries
 Until now released under Oracle Binary Code License
– Have to accept to download
– Classic "field-of-use" restriction
 Moving forward
– Binaries available under GPLv2 with CPE
– No more 32-bit binaries
– No more ARM binaries
– Windows, Linux, Mac and Solaris SPARC only
 All 64-bit
20
© Copyright Azul Systems 2017
JDK.${NEXT}
© Copyright Azul Systems 2017
JDK 18.3 10
 JSR 383 submitted and expert group formed
– Lead by Brian Goetz
– Oracle, IBM, Red Hat, SAP and Azul (Me)
 Schedule approved
– Development complete: 14/12/17
– Release candidate: 22/2/18
– General Availability: 20/3/18
 Early draft review already published
22
© Copyright Azul Systems 2017
JDK 18.3 10 (Current)
 JEP 286: Local variable type inference
var list = new ArrayList<String>(); // infers ArrayList<String>
var stream = list.stream(); // infers Stream<String>
 A few small API changes
– New replace method in java.util.Properties
– New toString method in java.util.concurrent.FutureTask
– Two new methods in java.lang.StackWalker.StackFrame
– Four new methods in java.util.concurrent.locks.StampedLock
23
© Copyright Azul Systems 2017
Longer Term JDK Futures
© Copyright Azul Systems 2017
Interesting Future JEPs
 JEP 304: GC Interface
– Internal JVM interface to allow easy change of GC
– Nice for us at Azul
 JEP 305: Pattern matching
– Type test and switch statement support to start
 JEP 310: Application class data sharing (CDS)
– Extend CDS to include application classes as well as JDK
 JEP 312: Thread-local handshakes
– JVM ability to stop individual threads
– Lower latency
25
© Copyright Azul Systems 2017
Project Amber
 JEP 286: Local variable type inference
– Already included in JDK 10
 JEP 301: Enhanced enums
– Generic enums
– Sharper type-checking of constants
 JEP 302: Lambda leftovers
– Underscores for unused parameters
– Shadowing of Lambda parameters
– Better disambiguation of functional expressions
26
© Copyright Azul Systems 2017
Project Valhalla
 Value types in Java
 Why do we need them?
27
Identity leads to pointers
Pointers lead to indirection
Indirection leads to suffering
(of performance)
© Copyright Azul Systems 2017
Project Valhalla
 Java has:
– Primitives: for performance
– Objects: for encapsulation, polymorphism, inheritance, OO
 Problem is where we want to use primitives but can't
– ArrayList<int> won't work
– ArrayList<Integer> requires boxing and unboxing,
object creation, heap overhead, indirection reference
28
© Copyright Azul Systems 2017
Project Valhalla
 Value types
 "Codes like a class, works like a primitive"
– Can have methods and fields
– Can implement interfaces
– Can use encapsulation
– Can be generic
29
© Copyright Azul Systems 2017
Project Panama
 Interconnecting JVM and native code
– Native function calls from JVM (C, C++)
– Native data access from JVM or inside JVM heap
– Header file API extraction tools
– Native library management APIs
– Class and method resolution “hooks”
– Native-oriented JIT optimizations
30
© Copyright Azul Systems 2017
Project Loom
 Further work on making concurrent programming simpler
 Threads are too heavyweight
– Too much interaction with operating system
 Loom will introduce fibres
– JVM level threads (remember green threads?)
– Add continuations to the JVM
– Use the ForkJoinPool scheduler
– Much lighter weight than threads
 Less memory
 Close to zero overhead for task switching
31
© Copyright Azul Systems 2017
Conclusions
© Copyright Azul Systems 2017
Java Continues Moving Forward
 JDK 9 is out
– But not an LTS
– JPMS may require changes to existing applications
 Faster Java releases
– Feature release every 6 months, LTS every 3 years
– OpenJDK binaries under GPLv2 with CPE license
 Lots of ideas to improve Java
– Value types, better JNI, better type inference
– Many smaller things
33
© Copyright Azul Systems 2017
Zulu Java
 Azul’s binary distribution of OpenJDK
– Passes all TCK tests
– Multi-platform (Windows, Linux, Mac)
– FREE!
 Happy to sell you support, including older versions
 JDK 6, 7, 8 and 9
34
www.zulu.org/download
© Copyright Azul Systems 2017
© Copyright Azul Systems 2015
@speakjava
Thank you!
Simon Ritter
Deputy CTO, Azul Systems
35

Contenu connexe

Tendances

Tendances (20)

What's New in Java 9
What's New in Java 9What's New in Java 9
What's New in Java 9
 
JDK 9: 55 New Features
JDK 9: 55 New FeaturesJDK 9: 55 New Features
JDK 9: 55 New Features
 
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 Support: What's changing
Java Support:  What's changingJava Support:  What's changing
Java Support: What's changing
 
Building a Brain with Raspberry Pi and Zulu Embedded JVM
Building a Brain with Raspberry Pi and Zulu Embedded JVMBuilding a Brain with Raspberry Pi and Zulu Embedded JVM
Building a Brain with Raspberry Pi and Zulu Embedded JVM
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12
 
JDK-9: Modules and Java Linker
JDK-9: Modules and Java LinkerJDK-9: Modules and Java Linker
JDK-9: Modules and Java Linker
 
Oracle Keynote from JMagghreb 2014
Oracle Keynote from JMagghreb 2014Oracle Keynote from JMagghreb 2014
Oracle Keynote from JMagghreb 2014
 
Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9
 
Java: Create The Future Keynote
Java: Create The Future KeynoteJava: Create The Future Keynote
Java: Create The Future Keynote
 
Java 9 Modularity and Project Jigsaw
Java 9 Modularity and Project JigsawJava 9 Modularity and Project Jigsaw
Java 9 Modularity and Project Jigsaw
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still Free
 
The latest features coming to Java 12
The latest features coming to Java 12The latest features coming to Java 12
The latest features coming to Java 12
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New Features
 
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)
 
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
 
Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9
 
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)
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9
 

Similaire à JDK 9: Mission Accomplished. What Next For Java?

10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
Martin Fousek
 
PaaS on Openstack
PaaS on OpenstackPaaS on Openstack
PaaS on Openstack
Open Stack
 

Similaire à JDK 9: Mission Accomplished. What Next For Java? (20)

55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8
 
Contributing to JDK Mission Control
Contributing to JDK Mission ControlContributing to JDK Mission Control
Contributing to JDK Mission Control
 
SOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the CloudSOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the Cloud
 
Java8 - Under the hood
Java8 - Under the hoodJava8 - Under the hood
Java8 - Under the hood
 
Java SE 8
Java SE 8Java SE 8
Java SE 8
 
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
 
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
 
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
 
Project Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To JavaProject Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To Java
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
PaaS on Openstack
PaaS on OpenstackPaaS on Openstack
PaaS on Openstack
 

Plus de Simon Ritter

Plus de Simon Ritter (15)

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type Patterns
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern Java
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
 
Java after 8
Java after 8Java after 8
Java after 8
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDK
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans Technology
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java Technology
 
It's Java, Jim, but not as we know it
It's Java, Jim, but not as we know itIt's Java, Jim, but not as we know it
It's Java, Jim, but not as we know it
 
Whats New For Developers In JDK 9
Whats New For Developers In JDK 9Whats New For Developers In JDK 9
Whats New For Developers In JDK 9
 
Streams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The UglyStreams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The Ugly
 

Dernier

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Dernier (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

JDK 9: Mission Accomplished. What Next For Java?

  • 1. © Copyright Azul Systems 2017 © Copyright Azul Systems 2015 @speakjava JDK 9: Mission Accomplished What Next For Java? Simon Ritter Deputy CTO, Azul Systems 1
  • 2. © Copyright Azul Systems 2017 JDK 9
  • 3. © Copyright Azul Systems 2017 JDK 9: Big And Small Changes 3
  • 4. © Copyright Azul Systems 2017 Java Platform Module System  The core Java libraries are now a set of modules – 97 modules for JDK, 28 of which are Java SE – No more rt.jar or tools.jar files  Most internal APIs are now encapsulated – sun.misc.Unsafe, etc. – Numerous libraries and frameworks use internal APIs  Module path used to locate modules – Separate and distinct from classpath 4
  • 5. © Copyright Azul Systems 2017 JDK 9 And Compatibility 5 "Clean applications that just depend on java.se should just work" - Oracle The java.se.ee module is not included on the modulepath for javac or the JVM by default
  • 6. © Copyright Azul Systems 2017 JPMS And Existing Applications  Initially, leave everything on the classpath  Anything on the classpath is in the unnamed module – All packages are exported – The unnamed module depends on all modules  Migrate to modules as required – Try automatic modules – Move existing jar files from classpath to modulepath 6
  • 7. © Copyright Azul Systems 2017 Breaking Encapsulation  "The Big Kill Switch" to turn off encapsulation – --illegal-access  permit: Warning for first use of an encapsulated API  warn: Warning for every use of an encapsulated API  debug: Warning and stack trace for every use  deny: No access to encapsulated APIs 7
  • 8. © Copyright Azul Systems 2017 Breaking Encapsulation  Allowing direct access to encapsulated APIs – --add-exports  Allowing reflective access to encapsulated APIs – --add-opens 8 --add-exports java.management/com.sun.jmx.remote.internal=mytest --add-exports java.management/sun.management=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
  • 9. © Copyright Azul Systems 2017 jlink: The Java Linker (JEP 282) 9 Modular run-time image …confbin jlink $ jlink --modulepath $JDKMODS --addmods java.base –output myimage $ myimage/bin/java –-list-modules java.base@9 jmods
  • 10. © Copyright Azul Systems 2017 jlink: The Java Linker (JEP 282) $ jlink --module-path $JDKMODS:$MYMODS --addmods com.azul.app –-output myimage $ myimage/bin/java –-list-modules java.base@9 java.logging@9 java.sql@9 java.xml@9 com.azul.app@1.0 com.azul.zoop@1.0 com.azul.zeta@1.0
  • 11. © Copyright Azul Systems 2017 The Implications Of jlink  "Write once, run anywhere" – Long term Java slogan, mainly held true  jlink generated runtime may not include all Java SE modules – But is still a conformant Java implementation – To be conformant:  It must include the java.base module  If other modules are included, all transitive module dependencies must also be included – Defined as a closed implementation
  • 12. © Copyright Azul Systems 2017 JDK Development Changes
  • 13. © Copyright Azul Systems 2017 OpenJDK: New Release Model  A new version of the JDK will be released every six months – March and September – Starting next year  OpenJDK development will be more agile – Previous target was a release every two years  Three and a half years between JDK 8 and JDK 9  Features will be included only when ready – Targeted for a release when feature complete – Not targeted at specific release when started 13
  • 14. © Copyright Azul Systems 2017 OpenJDK: More Open Source  Oracle will open-source closed-source parts of the JDK – Flight recorder – Mission control  The goal is for there to be no functional difference between an Oracle binary and a binary built from OpenJDK source – Targeted for completion late 2018 14
  • 15. © Copyright Azul Systems 2017 JDK Version Numbering  New scheme introduced in JDK 9 (JEP 223) – JDK ${MAJOR}.${MINOR}.${SECURITY} – Semantic versioning – Easier to understand by humans and computers 15
  • 16. © Copyright Azul Systems 2017 JDK Version Numbering  New proposal for subsequent releases – JDK ${YEAR}.${MONTH}  JDK 18.3, JDK 18.9, etc. – Same concept as used by Ubuntu – Many people not happy about this 16
  • 17. © Copyright Azul Systems 2017 JDK Version Numbering  New, new scheme. Just proposed – $FEATURE.$INTERIM.$UPDATE.$EMERG – FEATURE: Was MAJOR, i.e. 10, 11, etc. – INTERIM: Was MINOR. Reserved for future use – UPDATE: Was SECURITY, but with different incrementing rule – EMERG: Emergency update outside planned schedule 17
  • 18. © Copyright Azul Systems 2017 Availability Of JDK Updates  Oracle are switching to a long term support (LTS) model  LTS release will have 3 years of public updates – JDK 8 has been classified as an LTS release  It will have updates for more than 3 years – Next LTS release will be September, 2018  Non-LTS releases are "Feature Releases" – JDK 9 is a feature release – Public updates only until next feature release  JDK 9 public updates end in March, 2018 18
  • 19. © Copyright Azul Systems 2017 Deprecated in JDK 9: Soon To Go  Applets as a deployment mechanism  CMS garbage collector  Java policy tool, jconsole, Doclet API, other small things  java.se.ee meta-module  java.corba  java.transaction  java.activation  java.xml.bind  java.xml.ws  java.xml.ws.annotation 19
  • 20. © Copyright Azul Systems 2017 Oracle Binaries  Until now released under Oracle Binary Code License – Have to accept to download – Classic "field-of-use" restriction  Moving forward – Binaries available under GPLv2 with CPE – No more 32-bit binaries – No more ARM binaries – Windows, Linux, Mac and Solaris SPARC only  All 64-bit 20
  • 21. © Copyright Azul Systems 2017 JDK.${NEXT}
  • 22. © Copyright Azul Systems 2017 JDK 18.3 10  JSR 383 submitted and expert group formed – Lead by Brian Goetz – Oracle, IBM, Red Hat, SAP and Azul (Me)  Schedule approved – Development complete: 14/12/17 – Release candidate: 22/2/18 – General Availability: 20/3/18  Early draft review already published 22
  • 23. © Copyright Azul Systems 2017 JDK 18.3 10 (Current)  JEP 286: Local variable type inference var list = new ArrayList<String>(); // infers ArrayList<String> var stream = list.stream(); // infers Stream<String>  A few small API changes – New replace method in java.util.Properties – New toString method in java.util.concurrent.FutureTask – Two new methods in java.lang.StackWalker.StackFrame – Four new methods in java.util.concurrent.locks.StampedLock 23
  • 24. © Copyright Azul Systems 2017 Longer Term JDK Futures
  • 25. © Copyright Azul Systems 2017 Interesting Future JEPs  JEP 304: GC Interface – Internal JVM interface to allow easy change of GC – Nice for us at Azul  JEP 305: Pattern matching – Type test and switch statement support to start  JEP 310: Application class data sharing (CDS) – Extend CDS to include application classes as well as JDK  JEP 312: Thread-local handshakes – JVM ability to stop individual threads – Lower latency 25
  • 26. © Copyright Azul Systems 2017 Project Amber  JEP 286: Local variable type inference – Already included in JDK 10  JEP 301: Enhanced enums – Generic enums – Sharper type-checking of constants  JEP 302: Lambda leftovers – Underscores for unused parameters – Shadowing of Lambda parameters – Better disambiguation of functional expressions 26
  • 27. © Copyright Azul Systems 2017 Project Valhalla  Value types in Java  Why do we need them? 27 Identity leads to pointers Pointers lead to indirection Indirection leads to suffering (of performance)
  • 28. © Copyright Azul Systems 2017 Project Valhalla  Java has: – Primitives: for performance – Objects: for encapsulation, polymorphism, inheritance, OO  Problem is where we want to use primitives but can't – ArrayList<int> won't work – ArrayList<Integer> requires boxing and unboxing, object creation, heap overhead, indirection reference 28
  • 29. © Copyright Azul Systems 2017 Project Valhalla  Value types  "Codes like a class, works like a primitive" – Can have methods and fields – Can implement interfaces – Can use encapsulation – Can be generic 29
  • 30. © Copyright Azul Systems 2017 Project Panama  Interconnecting JVM and native code – Native function calls from JVM (C, C++) – Native data access from JVM or inside JVM heap – Header file API extraction tools – Native library management APIs – Class and method resolution “hooks” – Native-oriented JIT optimizations 30
  • 31. © Copyright Azul Systems 2017 Project Loom  Further work on making concurrent programming simpler  Threads are too heavyweight – Too much interaction with operating system  Loom will introduce fibres – JVM level threads (remember green threads?) – Add continuations to the JVM – Use the ForkJoinPool scheduler – Much lighter weight than threads  Less memory  Close to zero overhead for task switching 31
  • 32. © Copyright Azul Systems 2017 Conclusions
  • 33. © Copyright Azul Systems 2017 Java Continues Moving Forward  JDK 9 is out – But not an LTS – JPMS may require changes to existing applications  Faster Java releases – Feature release every 6 months, LTS every 3 years – OpenJDK binaries under GPLv2 with CPE license  Lots of ideas to improve Java – Value types, better JNI, better type inference – Many smaller things 33
  • 34. © Copyright Azul Systems 2017 Zulu Java  Azul’s binary distribution of OpenJDK – Passes all TCK tests – Multi-platform (Windows, Linux, Mac) – FREE!  Happy to sell you support, including older versions  JDK 6, 7, 8 and 9 34 www.zulu.org/download
  • 35. © Copyright Azul Systems 2017 © Copyright Azul Systems 2015 @speakjava Thank you! Simon Ritter Deputy CTO, Azul Systems 35

Notes de l'éditeur

  1. JEP 312: Global safepoint