In this post I will share my notes on a great talk given by Simon Ritter titled “JDK from 9 to 13 How Java is Evolving with Simon Ritter”. Simon Ritter is Deputy CTO of Azul Systems and has been in the field for a long time. The talk was organized by the Java User Group Campinas and sponsored by Movile and Wavy company in Campinas city state of São Paulo, Brazil. The notes below summarize my understanding on the subject talked during the lecture, so let me know whether I made any misunderstanding.
Simon presented an overview of how java is evolving and the main changes since JDK 9 up to know. Java had been changing a lot its binary and the delivery strategy. The JDK 9 from 2 years ago was the last major release with the introduction of about 90 new features, JDK 9 and 10 were intermediate versions where Oracle started to clean upand remove deprecated features. Some of features included on JDK 9 are:
- Java Platform Module System (JPMS): Allowed the grouping of packages from the previous version and ended up with 26 main modules for creation of run time specific for you application.
- JEP 260: Encapsulate Most Internal APIs: Encapsulate most of the JDK’s internal APIs by default so that they are inaccessible at compile time, and prepare for a future release in which they will be inaccessible at run time.
- JEP 282: jlink: The Java Linker: Tool that can assemble and optimize a set of modules and their dependencies into a custom run-time image.
The new release model for delivery new versions on every 6 months brings more agility to the development and allow the adoption of new features fast. I will be very happy when cloud providers start to deliver new JDK versions as fast as JDK is released. The Long Term Support (LTS) for the JDK is now eligible every 3 years and the current LTS version is JDK 11, this means that Oracle will delivery fixes to JDK 11 until the next LTS release be launched.
The OpenJDK also had evolved to be align with JDK releases, so the OpenJDK 11 and JDK 11 now has the same features and the goals is that boths evolve together. One of the main differences between OpenJDK and JDK is regarding the license model, while JDK 11 and beyond is free only for development and testing environment and you have to pay a Oracle Java SE subscription to use it on production the OpenJDK uses a GPLv2 license with no restriction of use. The JDK 8 remain indefinitely free however without official updates like security patches and bug fixes.
The JDK 10 came with the introduction of cool new features like these one:
- JEP 286: Local-Variable Type Inference: Enhance the Java Language to extend type inference to declarations of local variables with initializers.
- JEP 307: Parallel Full GC for G1: Improve G1 worst-case latencies by making the full GC parallel.
- JEP 310: Application Class-Data Sharing: Improve startup and footprint.
- JEP 317: Experimental Java-Based JIT Compiler: Enable the Java-based JIT compiler, Graal, to be used as an experimental JIT compiler on the Linux/x64 platform.
- New APIs for Collections, Strings and much more.
The JDK 11 is consider the start point for the new direction that Oracle gave to Java, some of the new features are:
- JEP 323: Local-Variable Syntax for Lambda Parameters: Allow var to be used when declaring the formal parameters of implicitly typed lambda expressions.
- JEP 330: Launch Single-File Source-Code Programs: Enhance the java launcher to run a program supplied as a single file of Java source code.
- JEP 181: Nest-Based Access Control: Introduce nests, an access-control context that aligns with the existing notion of nested types.
- JEP 309: Dynamic Class-File Constants: Extend the Java class-file format to support a new constant-pool form.
- JEP 318: Epsilon: A No-Op Garbage Collector: Develop a GC that handles memory allocation but does not implement any actual memory reclamation mechanism.
- JEP 321: HTTP Client (Standard): Standardize the incubated HTTP Client API introduced in JDK 9, via JEP 110, and updated in JDK 10.
- JEP 333: ZGC: A Scalable Low-Latency Garbage Collector: The Z Garbage Collector, also known as ZGC, is a scalable low-latency garbage collector.
- Inclusion of the a new Predicate, not(Predicate) to allow cool thinks like list.stream().filter(not(String::isEmpty)
- Removal of APIs including the ones related with Java EE like java.xml and java.xm.ws.
- And much more…
The JDK 12 started as the first in the new model of deliver every 6 month and it came with nice features as well, a highlight to JEP 346 bellow:
- JEP 346: Promptly Return Unused Committed Memory from G1: Enhance the G1 garbage collector to automatically return Java heap memory to the operating system when idle.
- JEP 325: Switch Expressions: Extend the switch statement so that it can be used as either a statement or an expression.
- JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector: Add a new garbage collection (GC) algorithm named Shenandoah which reduces GC pause times by doing evacuation work concurrently with the running Java threads.
- JEP 344: Abortable Mixed Collections for G1: Make G1 mixed collections abortable if they might exceed the pause target.
- And much more…
The JDK 13 is coming and here are some features that are planned and cool projects already started:
- JEP 355: Text Blocks (Preview): Included multi-line string literal that avoids the need for most escape sequences, automatically formats the string in a predictable way, and gives the developer control over format when desired.
- JEP 354: Switch Expressions (Preview): Extend switch with the inclusion of the yield keyword.
- Project Valhalla: Provide a venue to explore and incubate advanced Java VM and Language feature candidates.
- Project Loom: Explore and incubate Java VM features and APIs built on top of them for the implementation of lightweight user-mode threads
At the end Simon present the Zulu JDK, a JDK made for his company as a solution for companies that want keep using JDK 8 and receive secure updates even after the Oracle stops do that.
It was a great talk, Simon mastered the subject and expose in a object way the main features introduced and how agility the evolving of Java will be in the next years. The model of delivery fast excited me because nice features can be introduced in JDK every 6 months while language become more fun to write and JVM more robust. I wish cloud providers can make this versions available as fast as oracle has released it. Other thing that make me happy was the ability of java to automatically return Java heap memory to the operating system when idle, this is an amazing feature. See my other post here Automatic Vertical Scaling of the Java Heap.