Oracle just released Java JDK 20 (not an LTS version) on 21 March 2023 which is the 11th release as a part of a six-month release cadence.
JDK 20 is now available for all developers, end-users, and enterprises and can be downloaded for Windows, Linux, and macOS from the official Oracle Java Download page
https://www.oracle.com/java/technologies/downloads/
Linux:
Arm 64 Compressed Archive: https://download.oracle.com/java/20/latest/jdk-20_linux-aarch64_bin.tar.gz
Arm 64 RPM Package: https://download.oracle.com/java/20/latest/jdk-20_linux-aarch64_bin.rpm
x64 Compressed Archive: https://download.oracle.com/java/20/latest/jdk-20_linux-x64_bin.tar.gz
x64 Debian Package: https://download.oracle.com/java/20/latest/jdk-20_linux-x64_bin.deb
x64 RPM Package: https://download.oracle.com/java/20/latest/jdk-20_linux-x64_bin.rpm
macOS:
Arm 64 Compressed Archive: https://download.oracle.com/java/20/latest/jdk-20_macos-aarch64_bin.tar.gz
Arm 64 DMG Installer: https://download.oracle.com/java/20/latest/jdk-20_macos-aarch64_bin.dmg
x64 Compressed Archive: https://download.oracle.com/java/20/latest/jdk-20_macos-x64_bin.tar.gz
x64 DMG Installer: https://download.oracle.com/java/20/latest/jdk-20_macos-x64_bin.dmg
Windows:
x64 Compressed Archive: https://download.oracle.com/java/20/latest/jdk-20_windows-x64_bin.zip
x64 Installer: https://download.oracle.com/java/20/latest/jdk-20_windows-x64_bin.exe
x64 MSI Installer: https://download.oracle.com/java/20/latest/jdk-20_windows-x64_bin.msi
As other non-LTS releases JDK 20 includes over 1,595 contributions (tickets) by Oracle and other companies and individuals. Major contributors other than Oracle include Red Hat, SAP, Google, ARM, Amazon, Intel, IBM, Alibaba, BellSoft, Loongson, Azul, and Tencent.
✏️ New features released
(D)TLS Key Exchange Named Groups
In the package javax.net.ssl new methods getNamedGroups() and setNamedGroups() are been introduced that will allow having custom name groups of key exchanges algorithms used in individual TLS or DTLS connections. |
By using the setNamedGroups() one can set a prioritized array of key exchange named groups names that can be used over the SSL/TLS/DTLS protocols.
public String[] getNamedGroups()
public void setNamedGroups(String[] namedGroups)
The list of these key exchanges can be found at https://docs.oracle.com/en/java/javase/18/docs/specs/security/standard-names.html
This new method is supported by JDK SunJSSE provider.
1. Support Unicode 15.0
Package: java.lang
Class: Character
Unicode 15.0 was released in September 2022 with includes an updated version Unicode Character Database and 31 new emojis and is now supported by JDK 20.
The class to look for here is Character under java.lang package.
1. Arabic Extended-C
2. Devanagari Extended-An
3. Kawi
4. Kaktovik Numerals
5. Cyrillic Extended-D
6. Nag Mundari
7. CJK Unified Ideographs Extension H
2. New GarbageCollectorMXBean G1 Concurrent GC
Java 20 has introduced a new GarbageCollectorMXBean called "G1 Concurrent GC" to the collection of G1 garbage collector.
This new GarbageCollectorMXBean provides information on the duration and frequency of the garbage collection pauses for the Remark and Cleanup phases.
3. New JFR Event: jdk.SecurityProviderService
Packages: jdk.internal.event
Class: SecurityProviderServiceEvent
public final class SecurityProviderServiceEvent extends Event
This is a new Java Flight Recorder (JFR) event introduced to record details of java.security.Provider.getService(String type, String algorithm) calls.
Note: SecurityProviderServiceEvent event is disabled by default, you can enable it in JFR configuration files or standard JFR options.
4. New command line option --compress for jmod
This new --compress command line option has been added to the jmod tool used to create, extract, and list the contents of JMOD files that was introduced in Java 9. The compress option will be used to denote the compression level when creating the JMOD archive.
The accepted values are zip-[0-9], where zip-0 provides no compression, and zip-9 provides the best compression. Default value is zip-6.
5. Javac Warns about Type Casts in Compound Assignments with Possible Lossy Conversions
The Java compiler, javac, now includes a new lint option called "lossy-conversions" which can be used to detect type casts in compound assignments that could result in data loss.
This warning can be supressed using @SuppressWarnings("lossy-conversions") annotation.
✏️ Features and options are deprecated in Java 20
You will see an annotation @Deprecated(since = "20") on the below classes or methods that have been deprecated since Java 20
1. java.net.URL Constructors
URL(String, String, int, String)
URL(String, String, String)
URL(String, String, int, String, URLStreamHandler)
URL(String} m a URL(URL, String)
URL(URL, String, URLStreamHandler)
All the constructors from java.net.URL have been deprecated and developers as encouraged to make use of the java.net.URI
2. JMX Management Applets is deprecated and set for Removal
-
Package: javax.management.loading
MLet.class
MLetContent.class
MLetMBean.class
MLetObjectInputStream.class
MLetParser.class
✏️ Features and options that have been removed
1. Thread.suspend()/resume() changed to Throw UnsupportedOperationException
From JDK 20 onwards you cannot suspend or resume a thread with the help of Thread.suspend() and Thread.resume() methods as they have been removed in this release these methods have been changed to UnsupportedOperationException since Java JDK 19.
2. Thread.stop() changed to Throw UnsupportedOperationException
The stop method has been deprecated since JDK 1.2. You cannot stop a thread Thread.stop() as this method has been removed in JDK 20. Instead make use of throw UnsupportedOperationException which was added in Java JDK 19.
✏️ New Features JEPs
- JEP 429: Scoped Values (Incubator)
- JEP 432: Record Patterns (Second Preview)
- JEP 433: Pattern Matching for switch (Fourth Preview)
- JEP 434: Foreign Function & Memory API (Second Preview)
- JEP 436: Virtual Threads (Second Preview)
- JEP 437: Structured Concurrency (Second Incubator)
- JEP 438: Vector API (Fifth Incubator)
Read more: https://openjdk.org/projects/jdk/20/
Facing issues? Have Questions? Post them here! I am happy to answer!
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
- Get the current timestamp in Java
- Java Stream with Multiple Filters Example
- Java SE JDBC with Prepared Statement Parameterized Select Example
- Fix: UnsupportedClassVersionError: Unsupported major.minor version 63.0
- [Fix] Java Exception with Lambda - Cannot invoke because object is null
- 7 deadly java.lang.OutOfMemoryError in Java Programming
- How to Calculate the SHA Hash Value of a File in Java
- Java JDBC Connection with Database using SSL (https) URL
- How to Add/Subtract Days to the Current Date in Java
- Create Nested Directories using Java Code
- Spring Boot: JDBCTemplate BatchUpdate Update Query Example
- What is CA FE BA BE 00 00 00 3D in Java Class Bytecode
- Save Java Object as JSON file using Jackson Library
- Adding Custom ASCII Text Banner in Spring Boot Application
- [Fix] Java: Type argument cannot be of primitive type generics
- List of New Features in Java 11 (JEPs)
- Java: How to Add two Maps with example
- Java JDBC Transition Management using PreparedStatement Examples
- Understanding and Handling NullPointerException in Java: Tips and Tricks for Effective Debugging
- Steps of working with Stored Procedures using JDBCTemplate Spring Boot
- Java 8 java.util.Function and BiFunction Examples
- The Motivation Behind Generics in Java Programming
- Get Current Local Date and Time using Java 8 DateTime API
- Java: Convert Char to ASCII
- Deep Dive: Why avoid java.util.Date and Calendar Classes
- AWS SNS CLI Command Publish Message Attributes - AWS
- Fix Error CAA50021 - Number of retry attempts exceeds expectation - Microsoft 365 Apps - Microsoft
- How to add hint text in bootstrap input text field and text area - Bootstrap
- Change Mouse Scrolling in Mac OS X - Mac-OS-X
- Get Client IP address from HTTP Response in Java - Java
- How to Press a Enter in Cell for New Line on Microsoft Excel on Mac - Windows
- Common Microsoft Teams sign in errors and how to fix - Teams
- PowerShell ps1 script is not digitally signed, you cannot run this script on the current system - Powershell