on
Java Updates Guide
This page aims to tell and keep a log about updates in Java. Java is adopting a new cadence-based release cycle of the new releases and versions, and if you haven’t caught up yet – this is a good place to start. You can come back after each release to read and know more about it.
Last update: 2021.03.17 *
A word about the new Release Cycle
Now, a Java version arrives every six months, and this speeds up the development of Java. It is a good idea on its own but can confuse people that got used to waiting for a new Java version to be released after years and not six months. We’re also more expected to see new types of features labeled Preview, Incubating, and Experimental and an LTS versions will be released each three years.
Java 9, 21 September 2017
Java 9 features 81 JEPs.
- The Module System (aka Project Jigsaw)
-
Variable Handles – equivalents of
java.util.concurrent.atomic
andsun.misc.Unsafe
operations upon object fields and array elements - JShell – a dedicated REPL
- G1 – make G1 the default garbage collector on 32- and 64-bit server configurations
- Stalk-Walking API – provide an API to access lazily the information in stack traces
- Convenience Factory Methods for Collections – collections can be now initialized using
of()
methods
Java 10, 20 March 2018
Java 10 features 12 JEPs and various small API additions.
- First one to be released under the new release cycle
- Local-Variable Type Inference (var) – enhance the language to extend type inference to declarations of local variables with initializers
- Garbage Collector interface – improve the source code isolation of different GCs by introducing a clean GC interface
- Parallel Full GC for G1 – improve G1 worst-case latencies by making the full GC parallel
- Application Class-Data Sharing (“CDS”) – improve startup and footprint, extend the existing CDS feature to allow application classes to be placed in the shared archive.
- Collectors to be used with unmodifiable collections
Java 11, 25 September 2018
Java 11 is the first LTS release and includes 17 JEPs.
- HTTP Client – standardize the incubated HTTP Client API introduced in Java 9, and updated in Java 10
- Flight Recorder – provide a low-overhead data collection framework for troubleshooting Java applications and the HotSpot JVM
- A Scalable Low-Latency GC
- A No-Op Garbage Collector – handles memory allocation but does not implement any actual memory reclamation mechanism
- Java EE and CORBA modules got removed
- Nashorn deprecated
- Addition to
Optional
API,String
API
Java 12, 19 March 2019
Java 12 features 12 JEPs.
- Switch Expressions – can be used as either a statement or an expression
- G1 improvements – abortable mixed collections for G1, promptly return unused committed memory from G1
- Shenandoah – a Low-Pause-Time Garbage Collector
Java 13, 17 September 2019
Java 13 features 5 JEPs.
- Switch Expressions
- Socket API – replace the underlying implementation used by the
java.net.Socket
andjava.net.ServerSocket
APIs - ZGC - support for Linux/AArch64
Java 14, 17 March 2020
Java 12 features 16 JEPs.
- Pattern Matching for instanceof (Preview)
- Records (Preview)
- Switch Expressions (Standard)
- Text Blocks (Second Preview)
- Helpful NullPointerExceptions
- Packaging Tool (Incubator)
- to package Java applications as installation files (exe, msi, pkg, dmg, deb, rpm) for easy installation.
$ jpackage --name myapp --input lib --main-jar main.jar --main-class myapp.Main --type rpm
- NUMA-Aware Memory Allocation for G1
- Improve G1 performance on large machines by implementing NUMA-aware memory allocation.
- JFR (Java Flight Recorder) Event Streaming
- Expose JDK Flight Recorder data for continuous monitoring.
- Non-Volatile Mapped Byte Buffers
- Add new JDK-specific file mapping modes so that the FileChannel API can be used to create MappedByteBuffer instances that refer to non-volatile memory.
- Deprecate the Solaris and SPARC Ports
- Remove the Concurrent Mark Sweep (CMS) Garbage Collector
- ZGC on macOS
- Z Garbage Collector port to mac OS
- ZGC on Windows
- Z Garbage Collector port to Windows
- Deprecate the ParallelScavenge + SerialOld GC Combination
- Remove the Pack200 Tools and API
- Foreign-Memory Access API (Incubator)
- Introduce an API to allow Java programs to safely and efficiently access foreign memory outside of the Java heap.
Java 15, 15 September 2020
Java 15 features 14 JEPs.
- Edwards-Curve Digital Signature Algorithm (EdDSA)
- NamedParameterSpec.ED25519 to generate key pair, sign and verify messages.
- Sealed Classes (Preview)
- Hidden Classes
- only relevant for frameworks. They cannot be used directly by the bytecode of other classes, they are intended for use by the framework itself that generate classes at run time and use them indirectly, via reflection.
- Remove the Nashorn JavaScript Engine
- Java 11 deprecated the Nashorn JavaScript Engine, now it’s removed.
- Reimplement the Legacy DatagramSocket API
- Replace the underlying implementations of the
java.net.DatagramSocket
andjava.net.MulticastSocket
APIs with simpler and more modern implementations that are easy to maintain and debug.
- Replace the underlying implementations of the
- Disable and Deprecate Biased Locking
- Disable biased locking by default, and deprecate all related command-line options. Biased locking is an optimization technique used in the HotSpot VM to reduce the overhead of uncontended locking.
- Pattern Matching for instanceof (Second Preview)
if (msg instanceof String s && s.length() > 5)
- ZGC: A Scalable Low-Latency Garbage Collector
- Change the Z Garbage Collector from an experimental feature into production feature.
- Text Blocks (Preview)
- Shenandoah: A Low-Pause-Time Garbage Collector
- Change the Shenandoah garbage collector from an experimental feature into production feature.
- Remove the Solaris and SPARC Ports
- Remove the source code and build support for the Solaris/SPARC, Solaris/x64, and Linux/SPARC ports.
- Foreign-Memory Access API (Second Incubator)
- Introduce an API to allow Java programs to safely and efficiently access foreign memory outside of the Java heap.
- Records (Second Preview)
- Deprecate RMI Activation for Removal
- Deprecate the RMI Activation mechanism for future removal. RMI Activation is an obsolete part of RMI that has been optional since Java 8. No other part of RMI will be deprecated.
Java 16,
- Vector API (Incubator): provides vector computation (i.e. SIMD) supported by hardware instructions.
- Enable C++14 Language Features: allows the use of C++14 language features in JDK C++ source code, and give specific guidance about which of those features may be used in HotSpot code. means the code will be compiled with std=c++14 like options in all platforms.
- Migrate from Mercurial to Git
- Migrate to GitHub
- ZGC: Concurrent Thread-Stack Processing: Remaining activities that is left in GC safe-points in ZGC will be moved to concurrent phase to eliminate effectively all pause and scalability issues.
- Unix-Domain Socket Channels: Support for UNIX-domain sockets (AF_UNIX) through java.net.UnixDomainSocketAddress.
- Alpine Linux Port: port of JDK to Linux distributions using musl as the standard library such as Alpine Linux, both on x64 and AArch64.
- Elastic Metaspace: improve the use of the memory holding the class-metadata (metaspace). It will reduce the footprint and improve the efficiency of returning unused metaspace to the operating system.
- Windows/AArch64 Port: This will make a port of JDK to Windows on AArch64.
- Foreign Linker API (Incubator): This API will offer a pure-Java way to access native code, replacing JNI.
- Warnings for Value-Based Classes: Primitive wrapper classes, that are annotated as
@jdk.internal.ValueBased
, will have their constructors, which are already marked as deprecated in Java 9, will produce removal warnings. E.g. when using a Double as a synchronized object. - Packaging Tool: provides a way to generate platform native packages such as deb and rpm in Linux, pkg and dmg in macOS and msi and exe in Windows.
- Foreign-Memory Access API (Third Incubator): includes a simplified way to perform most common and/or simple tasks with MemoryAccess static class, without a need for VarHandle.
- Pattern Matching for instanceof: do
variable instanceof Type typedVar
checks—no more preview. - Records: A record is a nominal tuple that has no need for encapsulation—no more preview.
- Strongly Encapsulate JDK Internals by Default: change the default value of
--illegal-access
option from permit to deny. This means JDK internal classes other than critical APIs such assun.misc.Unsafe
will not be open by default. - Sealed Classes (Second Preview): A sealed class/interface can’t be extended/implemented except by the types it lists—one more preview.
More details on https://javaalmanac.io/, collection of information about the history and future of Java.