Java 9, 10, 11, 12…
@rorypreddy
"Moving Java Forward Faster"
20191995 1998 2001 2004 2007 2010 20222016
2014-03-18
2013-06-12
Java EE 7
2011-07-28
Java EE6
2009-12-10
2006-12-11
Java EE5
2006-05-11
2004-10-04
J2EE 1.4
2003-11-11
2002-02-06
J2EE 1.3
2001-09-24
2000-05-08
J2EE 1.2
1999-12-12
1998-12-08
JPE
Java
Professional
Edition
1998-05
1997-02-19
Java
JDK
Alpha-
Beta
1995
2010-01-27
Java1 Java1.1 Java1.2 Java 1.3 Java 1.4 Java5 Java SE 6 Java SE7 Java SE8
JDK 1.0 JDK 1.1 J2SE 1.2 J2SE 1.3 J2SE 1.4 J2SE 5.0
Oak Playground Kestrel Merlin Tiger Mustang Dolphin Spider
Java EE 8
2017-09-21
2013
1996-01-23
2017-09-21
2018-03-20
2018-09-25
2019-03
2019-09
2020-03
2020-09
2021-03
2021-09
Jakarta EE
Eclipse
Foundation
OpenJDK (New) Release Model
• New Features included (only) when ready
• Feature release versions released twice a year
• Update releases will ship quarterly
• Long-term support (LTS) feature release every three years
• Time-Based Release Versioning
JDK Version Numbering
• $FEATURE.$INTERIM.$UPDATE.$PATCH
• $FEATURE is incremented every six months
• $INTERIM is always zero, reserved for flexibility and future use
• $UPDATE is incremented one month after $FEATURE is incremented, and every three
months thereafter
• $PATCH is emergency patch-release counter
Available JDKs
• Oracle JDK www.oracle.com/technetwork/java/javase/downloads/
• Many OpenJDKs:
• Oracle OpenJDK jdk.java.net/11/
• Azul's Zulu OpenJDK www.azul.com/downloads/zulu/
• AdoptOpenJDK's OpenJDK adoptopenjdk.net
• AdoptOpenJDK's OpenJDK based on OpenJ9 adoptopenjdk.net
• RedHat's OpenJDK
• SAP's SapMachine OpenJDK
• Other Linux distribution's OpenJDKs
Demystifying "Free" Java
• $free as in free beer (cost) vs
free as in free speech (what can you do)
• For $free use OpenJDK binaries
• For free use OpenJDK with GPLv2+CE license
• Updates refers to code patches – typically $free
• Support means fixing bugs and answering questions – was never $free
Oracle's JDK is (not) "free"
• LTS release every 3 years – does not mean 3 years of free updates
• Oracle JDK 11 (and onward) can only be used in production with
commercial Java SE subscription
• Oracle JDK 8 can be used indefinitely for free
• Oracle will lead and contribute to each new JDK (every 6 months)
Open Sourcing and Converged Binaries
• Goal: No functional difference between OpenJDK and Oracle JDK in JDK 11
• Open sourcing closed-source parts of JDK
• Flight recorder
• Mission control
• …
• Removing some closed-source parts
• Browser Plugin
• Java Web Start
• JavaFX
• Backwards Compatibility – applications depending on Java SE should work
Converged Binaries
Up to JDK 10
Oracle JDK
OpenJDK
Java SE
JDK 11 and later
OpenJDK &
Oracle JDK
Java SE
(Long Term) Support
• Long Term Support (LTS) for all releases is not practical
• One Long Term Support release every three years
• Starting with JDK 11 (September 2018), then JDK 17 (September 2021), then JDK 23…
• For Oracle's commercial customers updates available for at least three years or longer
• JDK 9 – supported until March 2018 (release of JDK10)
• JDK 10 – supported until September 2018 (release of JDK 11)
• JDK 11 (September 2018) – free support until March 2019 (or 2022 commercial)
• JDK 12 (March 2019) …
JDK 9 – old news?
• Java Platform Module System (JPMS)
• All core Java libraries become modules
• 97 modules
• Most internal APIs encapsulated
• No more classpath hell
• Not widely adopted as yet
JDK 10
• JEPs included
• 286: Local-Variable Type Inference
• 296: Consolidate the JDK Forest into a Single Repository
• 304: Garbage-Collector Interface
• 307: Parallel Full GC for G1
• 310: Application Class-Data Sharing
• 312: Thread-Local Handshakes
• 313: Remove the Native-Header Generation Tool (javah)
• 314: Additional Unicode Language-Tag Extensions
• 316: Heap Allocation on Alternative Memory Devices
• 317: Experimental Java-Based JIT Compiler
• 319: Root Certificates
• 322: Time-Based Release Versioning
JDK 11
• JEPs included
• 181: Nest-Based Access Control
• 309: Dynamic Class-File Constants
• 315: Improve Aarch64 Intrinsics
• 318: Epsilon: A No-Op Garbage Collector
• 320: Remove the Java EE and CORBA Modules
• 321: HTTP Client (Standard)
• 323: Local-Variable Syntax for Lambda Parameters
• 324: Key Agreement with Curve25519 and Curve448
• 327: Unicode 10
• 328: Flight Recorder
• 329: ChaCha20 and Poly1305 Cryptographic Algorithms
• 330: Launch Single-File Source-Code Programs
• 331: Low-Overhead Heap Profiling
• 332: Transport Layer Security (TLS) 1.3
• 333: ZGC: A Scalable Low-Latency Garbage Collector
• 335: Deprecate the Nashorn JavaScript Engine
• 336: Deprecate the Pack200 Tools and API
//New Implicitly Typed Java 11+ Syntax
BiFunction<Double, Integer, Double> f3 = (var x, var y) -> x/y;
BiFunction<Double, Integer, Double> f4 = (@NotNull var x, @NotNull var y) -> x / y;
Double j = 3.;
Integer i = 2;
System.out.println(f4.apply(j, i));
Local-Variable Syntax for Lambda
Parameters
BiFunction<Double, Integer, Double> f3 = (Double x, Integer y) -> x/y;
Double j = 3.;
Integer i = 2;
System.out.println(f4.apply(j, i));
Launch Single-File Source-Code Programs
• Run a program supplied as a single file of Java source code
java -classpath /home/foo/java Hello.java Bonjour
• is equivalent to:
javac -classpath /home/foo/java Hello.java
java -classpath /home/foo/java Hello Bonjour
JDK 12
• JDK 12 is currently in Public Review
• 2018/05
• 2018/07
• 2018/10 - 2018/11
• 2019/01 - 2019/02
• 2019/03
Expert Group formation
Early Draft Review
Public Review
Proposed Final Draft
Final Release
• JEPs targeted to JDK 12, so far:
• 230: Microbenchmark Suite
• 325: Switch Expression enhacements
• 326: Raw String Literals
• 340: One AArch64 Port, Not Two
• 341: Default CDS Archives
• Schedule:
Backwards Compatibility
• It will be respected
• But with no guarantees
• New version may include breaking changes
• Anything for removal will be deprecated first
• Minimum of one release warning (6+ months)
Container Awareness and Java Jakarta EE
• JVM more Docker container aware
• Uses container CPU count and memory size
• Open sourcing Java EE
• Jakarta EE as a part of Eclipse Foundation
• Jakarta EE – Code first, then spec!
• Feed ideas back into Jakarta EE
• blogs.eclipse.org/post/mike-milinkovich/jakarta-ee-status-%E2%80%93-september-2018-update
Eclipse MicroProfile?
Q4
2016
Q2
2017
Q3
2017
Q1
2018
MP
v. 1.3
MP
v. 1.2
Move to MP
v. 1.1
Q2
2018
MP
v. 1.4 & 2.0
Q3
2018
MP
v. 2.1
Eclipse MicroProfile
Is Java really "Moving Forward Faster"?
• Much more frequent Java releases
• Faster access to new features
• Many new improvement ideas
• A lot of maintenance and housekeeping
• Java remains free
FROM panga/openjdk-alpine:11-jdk as builder
RUN jlink 
--add-modules java.sql,java.naming,java.management,java.instrument,java.security.jgss,java.desktop,jdk.unsupported 
--verbose 
--strip-debug 
--compress 2 
--no-header-files 
--no-man-pages 
--output /opt/jre-minimal
FROM alpine:3.8
COPY --from=builder /opt/jre-minimal /opt/jre-minimal
ENV LANG=C.UTF-8 
PATH=${PATH}:/opt/jre-minimal/bin
ADD modules /opt/app/modules
ARG JVM_OPTS
ENV JVM_OPTS=${JVM_OPTS}
CMD java ${JVM_OPTS} 
--add-opens java.base/java.lang=spring.core,javassist 
--module-path /opt/app/modules 
--module spring.petclinic
https://github.com/roryp/spring-petclinic

Whats new in Java 9,10,11,12

  • 1.
    Java 9, 10,11, 12… @rorypreddy
  • 2.
    "Moving Java ForwardFaster" 20191995 1998 2001 2004 2007 2010 20222016 2014-03-18 2013-06-12 Java EE 7 2011-07-28 Java EE6 2009-12-10 2006-12-11 Java EE5 2006-05-11 2004-10-04 J2EE 1.4 2003-11-11 2002-02-06 J2EE 1.3 2001-09-24 2000-05-08 J2EE 1.2 1999-12-12 1998-12-08 JPE Java Professional Edition 1998-05 1997-02-19 Java JDK Alpha- Beta 1995 2010-01-27 Java1 Java1.1 Java1.2 Java 1.3 Java 1.4 Java5 Java SE 6 Java SE7 Java SE8 JDK 1.0 JDK 1.1 J2SE 1.2 J2SE 1.3 J2SE 1.4 J2SE 5.0 Oak Playground Kestrel Merlin Tiger Mustang Dolphin Spider Java EE 8 2017-09-21 2013 1996-01-23 2017-09-21 2018-03-20 2018-09-25 2019-03 2019-09 2020-03 2020-09 2021-03 2021-09 Jakarta EE Eclipse Foundation
  • 3.
    OpenJDK (New) ReleaseModel • New Features included (only) when ready • Feature release versions released twice a year • Update releases will ship quarterly • Long-term support (LTS) feature release every three years • Time-Based Release Versioning
  • 4.
    JDK Version Numbering •$FEATURE.$INTERIM.$UPDATE.$PATCH • $FEATURE is incremented every six months • $INTERIM is always zero, reserved for flexibility and future use • $UPDATE is incremented one month after $FEATURE is incremented, and every three months thereafter • $PATCH is emergency patch-release counter
  • 5.
    Available JDKs • OracleJDK www.oracle.com/technetwork/java/javase/downloads/ • Many OpenJDKs: • Oracle OpenJDK jdk.java.net/11/ • Azul's Zulu OpenJDK www.azul.com/downloads/zulu/ • AdoptOpenJDK's OpenJDK adoptopenjdk.net • AdoptOpenJDK's OpenJDK based on OpenJ9 adoptopenjdk.net • RedHat's OpenJDK • SAP's SapMachine OpenJDK • Other Linux distribution's OpenJDKs
  • 6.
    Demystifying "Free" Java •$free as in free beer (cost) vs free as in free speech (what can you do) • For $free use OpenJDK binaries • For free use OpenJDK with GPLv2+CE license • Updates refers to code patches – typically $free • Support means fixing bugs and answering questions – was never $free
  • 7.
    Oracle's JDK is(not) "free" • LTS release every 3 years – does not mean 3 years of free updates • Oracle JDK 11 (and onward) can only be used in production with commercial Java SE subscription • Oracle JDK 8 can be used indefinitely for free • Oracle will lead and contribute to each new JDK (every 6 months)
  • 8.
    Open Sourcing andConverged Binaries • Goal: No functional difference between OpenJDK and Oracle JDK in JDK 11 • Open sourcing closed-source parts of JDK • Flight recorder • Mission control • … • Removing some closed-source parts • Browser Plugin • Java Web Start • JavaFX • Backwards Compatibility – applications depending on Java SE should work
  • 9.
    Converged Binaries Up toJDK 10 Oracle JDK OpenJDK Java SE JDK 11 and later OpenJDK & Oracle JDK Java SE
  • 10.
    (Long Term) Support •Long Term Support (LTS) for all releases is not practical • One Long Term Support release every three years • Starting with JDK 11 (September 2018), then JDK 17 (September 2021), then JDK 23… • For Oracle's commercial customers updates available for at least three years or longer • JDK 9 – supported until March 2018 (release of JDK10) • JDK 10 – supported until September 2018 (release of JDK 11) • JDK 11 (September 2018) – free support until March 2019 (or 2022 commercial) • JDK 12 (March 2019) …
  • 11.
    JDK 9 –old news? • Java Platform Module System (JPMS) • All core Java libraries become modules • 97 modules • Most internal APIs encapsulated • No more classpath hell • Not widely adopted as yet
  • 12.
    JDK 10 • JEPsincluded • 286: Local-Variable Type Inference • 296: Consolidate the JDK Forest into a Single Repository • 304: Garbage-Collector Interface • 307: Parallel Full GC for G1 • 310: Application Class-Data Sharing • 312: Thread-Local Handshakes • 313: Remove the Native-Header Generation Tool (javah) • 314: Additional Unicode Language-Tag Extensions • 316: Heap Allocation on Alternative Memory Devices • 317: Experimental Java-Based JIT Compiler • 319: Root Certificates • 322: Time-Based Release Versioning
  • 13.
    JDK 11 • JEPsincluded • 181: Nest-Based Access Control • 309: Dynamic Class-File Constants • 315: Improve Aarch64 Intrinsics • 318: Epsilon: A No-Op Garbage Collector • 320: Remove the Java EE and CORBA Modules • 321: HTTP Client (Standard) • 323: Local-Variable Syntax for Lambda Parameters • 324: Key Agreement with Curve25519 and Curve448 • 327: Unicode 10 • 328: Flight Recorder • 329: ChaCha20 and Poly1305 Cryptographic Algorithms • 330: Launch Single-File Source-Code Programs • 331: Low-Overhead Heap Profiling • 332: Transport Layer Security (TLS) 1.3 • 333: ZGC: A Scalable Low-Latency Garbage Collector • 335: Deprecate the Nashorn JavaScript Engine • 336: Deprecate the Pack200 Tools and API
  • 14.
    //New Implicitly TypedJava 11+ Syntax BiFunction<Double, Integer, Double> f3 = (var x, var y) -> x/y; BiFunction<Double, Integer, Double> f4 = (@NotNull var x, @NotNull var y) -> x / y; Double j = 3.; Integer i = 2; System.out.println(f4.apply(j, i)); Local-Variable Syntax for Lambda Parameters BiFunction<Double, Integer, Double> f3 = (Double x, Integer y) -> x/y; Double j = 3.; Integer i = 2; System.out.println(f4.apply(j, i));
  • 15.
    Launch Single-File Source-CodePrograms • Run a program supplied as a single file of Java source code java -classpath /home/foo/java Hello.java Bonjour • is equivalent to: javac -classpath /home/foo/java Hello.java java -classpath /home/foo/java Hello Bonjour
  • 16.
    JDK 12 • JDK12 is currently in Public Review • 2018/05 • 2018/07 • 2018/10 - 2018/11 • 2019/01 - 2019/02 • 2019/03 Expert Group formation Early Draft Review Public Review Proposed Final Draft Final Release • JEPs targeted to JDK 12, so far: • 230: Microbenchmark Suite • 325: Switch Expression enhacements • 326: Raw String Literals • 340: One AArch64 Port, Not Two • 341: Default CDS Archives • Schedule:
  • 17.
    Backwards Compatibility • Itwill be respected • But with no guarantees • New version may include breaking changes • Anything for removal will be deprecated first • Minimum of one release warning (6+ months)
  • 18.
    Container Awareness andJava Jakarta EE • JVM more Docker container aware • Uses container CPU count and memory size • Open sourcing Java EE • Jakarta EE as a part of Eclipse Foundation • Jakarta EE – Code first, then spec! • Feed ideas back into Jakarta EE
  • 19.
  • 20.
  • 21.
    Q4 2016 Q2 2017 Q3 2017 Q1 2018 MP v. 1.3 MP v. 1.2 Moveto MP v. 1.1 Q2 2018 MP v. 1.4 & 2.0 Q3 2018 MP v. 2.1 Eclipse MicroProfile
  • 22.
    Is Java really"Moving Forward Faster"? • Much more frequent Java releases • Faster access to new features • Many new improvement ideas • A lot of maintenance and housekeeping • Java remains free
  • 23.
    FROM panga/openjdk-alpine:11-jdk asbuilder RUN jlink --add-modules java.sql,java.naming,java.management,java.instrument,java.security.jgss,java.desktop,jdk.unsupported --verbose --strip-debug --compress 2 --no-header-files --no-man-pages --output /opt/jre-minimal FROM alpine:3.8 COPY --from=builder /opt/jre-minimal /opt/jre-minimal ENV LANG=C.UTF-8 PATH=${PATH}:/opt/jre-minimal/bin ADD modules /opt/app/modules ARG JVM_OPTS ENV JVM_OPTS=${JVM_OPTS} CMD java ${JVM_OPTS} --add-opens java.base/java.lang=spring.core,javassist --module-path /opt/app/modules --module spring.petclinic https://github.com/roryp/spring-petclinic