Java Releases¶
Java 21 (LTS)¶
- Record Patterns
- Pattern Matching for
switch
- String Literal, e.g.
STR."Welcome to \{name}"
- Virtual Threads
- Sequenced Collections, Sequenced Sets and Sequenced Maps
- Key Encapsulation Mechanism API
Java 20¶
- Scoped Values
- Records Patterns
- Pattern Matching for
switch
- Foreign Function & Memory API (2nd Preview)
- Virtual Threads (2nd Preview)
- Structured Concurrency
- Vector API Enhancements
Java 19¶
- Record Patterns (Preview)
- Linux/RISC-V Port
- Foreign Function & Memory API (Preview)
- Virtual Threads (Preview)
- Vector API (Fourth Incubator)
- Pattern Matching for
switch
(Third Preview) - Structured Concurrency (Incubator)
Java 18¶
- UTF-8 by Default
- Simple Web Server, e.g.
./jwebserver
- Code Snippets in Java API Documentation
- Reimplement Code Reflection with Method Handles
- Vector API (3rd Incubator)
- Internet-Address Resolution SPI
- Foreign Function & Memory API (2nd Incubator)
- Pattern Matching for
switch
(2nd Preview) - Deprecate Finalization for Removal
Java 17 (LTS)¶
- Restore Always-Strict Floating-Point Semantics (mainly for scientific applications)
- Enhanced Pseudo-Random Number Generators
- New macOS Rendering Pipeline
- macOS/AArch64 Port
- Deprecate the Applet API for Removal
- Strongly Encapsulate JDK Internals
- Pattern Matching for
switch
(Preview) - Remove RMI Activation
- Sealed Classes
- Remove the Experimental AOT and JIT Compiler
- Deprecate the Security Manager for Removal
- Foreign Function & Memory API (Incubator)
- Vector API (2nd incubator)
- Context-Specific Deserialization Filters
Java 16¶
- Invoke Default Methods from proxy instances.
- Day Period Support, e.g. "B" stands for "in the afternoon".
- Add Stream.toList Method. e.g.
integersAsString.stream().map(Integer::parseInt).toList()
- Incremental changes for Records
- New additions to Sealed Classes.
- Foreign linker API to access native code on the host machine.
Java 15¶
- New Type Records
- Sealed Classes, to allow individual classes to declare which type may be used as sub-types.
- Hidden Classes
- Pattern Matching Type Checks, e.g.
obj instance of String str
- Foreign Memory API (add some new features)
- Text Blocks (fully supported)
- Garbage Collectors enhancements
Java 14¶
- Switch Expressions Enhancements
- Text Blocks (Preview)
- Pattern Matching (Preview)
- new Type Records (Preview)
- Enhance info for NullPointerExceptions
- Deprecate or Remove a couple of features
Java 13¶
- Text Blocks
"""
(Preview) - New Methods in String Class for Text Blocks
- Switch Expressions Enhancements
- Reimplement the Legacy Socket API
- Dynamic CDS Archive
- ZGC: Uncommit Unused Memory
- FileSystems.newFileSystem() Method
- Support for Unicode 12.1
- DOM and SAX Factories with Namespace Support
Java 12¶
- JVM Changes
- Switch Expressions
- File mismatch() MethodCompact Number Formatting
- Teeing Collectors in Stream API
- Java Strings New Methods – indent(), transform(), describeConstable(), and resolveConstantDesc().
- JVM Constants API
- Pattern Matching for
instanceof
- Raw String Literals is Removed From JDK 12.
Java 11 (LTS)¶
- Running Java File with single command
- New utility methods in String class
- Local-Variable Syntax for Lambda Parameters
- Nested Based Access Control
- HTTP Client
- Reading/Writing Strings to and from the Files
- Flight Recorder
Java 10¶
- Local-Variable Type Inference
- Consolidate the JDK Forest into a Single Repository
- Garbage-Collector Interface
- Parallel Full GC for G1
- Application Class-Data Sharing
- Thread-Local Handshakes
- Remove the Native-Header Generation Tool (javah)
- Additional Unicode Language-Tag Extensions
- Heap Allocation on Alternative Memory Devices
- Experimental Java-Based JIT Compiler
- Root Certificates
- Time-Based Release Versioning
Java 9¶
- The Java Platform module system
- JShell: the interactive Java REPL(Read-Evaluate-Print-Loop)
- Private interface methods
- HTTP/2
- Improved java documentation
- Multi-release JARs
Java 8 (LTS)¶
- forEach() method in Iterable interface
- default and static methods in Interfaces
- Functional Interfaces and Lambda Expressions
- Java Stream API for Bulk Data Operations on Collections
- Java Time API
- Collection API improvements
- Concurrency API improvements
- Java IO improvements
- Miscellaneous Core API improvements
Java 7¶
- Diamond Operator.
- Using String in switch statements
- Automatic resource management
- Numeric literals with underscores
- Improved exception handling: Multiple catches in same block
- File change notifications
Java 6¶
Java 6 has a few important changes in terms of API's and a few improvement in performance.
Java 5¶
- Generics
- Enhanced for Loop
- Autoboxing / Unboxing
- Typesafe Enums
- Variable args
- Static Import
- Concurrent Collections
- Copy on Write
- Compare and Swap
- Locks