Ever since Java switched to its six-month release cadence (Time-Based Release Versioning) it has become a bit harder to keep up with the features they have implemented. The following list tracks the stable (not incubating or in preview) feature changes I deemed most noteworthy. The releases that Oracle will provide Long-Term Support (LTS) for are marked as such, based on the plan that Oracle publishes.
The list is ongoing and will be updated with every new Java release. A + marks an added feature, a - marks a removed feature.
-
22 (expected March 2024)
-
Preliminary opinion, since JDK rampdown and feature set freeze won’t happen before January.
-
This could be the release that finally delivers Primitive Classes Preview and Value Objects Preview. It might also finalize String templates.
-
-
-
21 (expected September 2023) LTS until September 2028
-
This is an amazing LTS release. We get virtual threads and we are very close at making Data Oriented Programming in Java a reality with these two features:
-
+Record patterns (
if (r instanceof Rectangle(ColoredPoint(Point(var x, var y)))){…}
) -
+Pattern matching for switch (
switch (obj) { case Integer i → … }
)
-
-
+Sequenced Collections (
list.addLast(…); map.putFirst(…); set.reversed()
etc.) -
+Virtual Threads (formerly Fibers)
-
-
20 (March 2023)
-
Another huge release feature-wise but all features are either in preview (again) or incubating (again).
-
In (2nd or 4th) Preview: Record Patterns, Pattern Matching for switch, Virtual Threads, Foreign Function and Memory Api
-
Incubating: Structured Concurrency, Scoped Values
-
-
19 (September 2022)
-
Huge release feature-wise but all features are either in preview or incubating.
-
In Preview: Record Patterns, Pattern Matching for switch, Virtual Threads, Foreign Function and Memory Api
-
Incubating: Vector API, Structured Concurrency
-
-
18 (March 2022)
-
UTF-8 by Default (Specify UTF-8 as the default charset of the standard Java APIs)
-
+Simple Web Server (command-line tool to start a minimal web server that serves static files only)
-
-
17 (September 2021) LTS until September 2026
-
+New macOS Rendering Pipeline (Create a new Swing Renderer based on Metal Api before Apple removes OpenGL Api)
-
+macOS/AArch64 Port (Port for Apple Silicon)
-
+Strongly Encapsulate JDK Internals by Default (except
sun.misc.Unsafe
, can no longer be relaced via command-line option) -
-Remove RMI Activation (only RMI Activation is removed after deprecation in 15)
-
+Sealed Classes and interfaces (
abstract sealed class Shape permits Circle, … {}
)
-
-
16 (March 2021)
-
+Pattern Matching for instanceof (Previews in 14 and 15)
-
+Records (Previews in 14 and 15)
-
Stream.toList()
-
-
15 (September 2020)
-
-Remove Nashorn JavaScript Engine (deprecated since 11))
-
+Text Blocks (multi-line string literals)
-
-
14 (March 2020)
-
+JFR Event Streaming (for continuous monitoring)
-
+Helpful Nullpointer exceptions (pinpoint what caused the nullpointer, not just filename and line number)
-
+Switch Expressions (no changes to preview in 13)
-
-
13 (September 2019): Smaller Release
-
12 (March 2019): Smaller Release
-
11 (September 2018) LTS until September 2023
-
-JavaFx (JavaFx was never part of Java SE but Oracle bundled it with their JDKs since 8. Now they’ve unbundled it and passed the torch to the OpenJFX project)
-
10 (March 2018)
-
+Local-Variable Type Inference (aka
var num = 42;
) -
+Recognizes constraints set by container control groups (cgroup) (before Java didn’t recognize that it was running in a container and used the maximum available resources, not the one for the cgroup; backported to JDK8)
-
+Optional API Additions
-
optional.orElseThrow()
clearer version ofoptional.get()
. Also allows us to specify the exception being thrown.
-
-
-
9 (September 2017)
-
+Modularized JDK (Project Jigsaw)
-
+JShell (Read-Eval-Print Loop)
-
+Interfaces supporting Reactive Streams (for interoperability across a number of async systems running on JVMs)
-
+Private Methods in Interfaces (can be called from default methods)
-
+Convenience Factory Methods for Collections
-
+
Set.of(a, b, c)
-
+
List.of(a, b, c)
-
+
Map.ofEntries(entry(k1, v1), entry(k2, v2))
-
-
+Optional API Additions
-
optional.or) → Optional.of("default"
-
optional.ifPresentOrElse(it → doSth(it), ::otherwise)
-
optional.stream()
-
-
-
8 (March 2014) LTS until March 2022
-
+Lambda-Expressions (Project Lambda)
-
+Default Methods for Interfaces
-
+Nashorn JavaScript Engine (supersedes Rhino JavaScript Engine)
-
+Date & Time API (
java.time
; inspired by Joda-Time; supersedesjava.util.Date
andjava.util.Calendar
) -
+
Optional<T>
-
-
7 (July 2011)
-
6 (2006)
-
+Rhino JavaScript Engine
-
+Dramatic performance improvements
-
-
5 (2004)
-
+Generics
-
+Autoboxing
-
+Enumerations
-
+Varargs
-
+
for each
-
+
java.util.concurrent
(ConcurrentHasMap etc.)
-
-
1.4 (2002)
-
+
assert
Keyword -
+
java.util.regex
-
+
java.nio
(Non-Blocking I/O)
-
-
1.3 (2000)
-
+HotSpot JVM
-
Last Release for Microsoft Windows 95 :)
-
-
1.2 (1998)
-
+Swing
-
+JIT-Compiler
-
+Collections-Framework
-
+Modify Objects via Reflection
-
-
1.1 (1997)
-
+inner classes
-
+RMI
-
+Serialization
-
+Reflection
-
-
1 (1996): Initial release
Note
|
The full Java version history can be found via Open JDK, at Wikipedia or via the Java releases page. Another website that tracks java features but also gives upgrading advice is whichjdk.com. |