
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/
Have Questions? Post them here!
- Create a Zip file using Java Code programmatically
- Eclipse : A java Runtime Environment (JRE) or Java Development kit (JDK) must be available
- How to Sort a LinkedList in Java
- Loading class com.mysql.jdbc.Driver. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver
- How to declare and initialize Array in Java Programming
- [Fix] java: integer number too large compilation error
- Java JDBC Connection with MySQL Driver in VS Code + Troubleshooting
- Reading .xls and .xlsx Excel file using Apache POI Java Library
- IntelliJ: Error: Could not find or load main class, java.lang.ClassNotFoundException
- How to get Client IP address using Java Code Example
- Truncate table using Java JDBC Example
- Struts 2 : There is no Action mapped for namespace [/] and action name [form] associated with context path [/proj]
- How to get file path in Idea IntelliJ IDE
- Java Generics explained with simple definition and examples
- Java SE 8 Update 301 available with various bug fixes and security improvements
- Java: Collect Stream as ArrayList or LinkedList
- Java JDBC Connection with PostgreSQL Driver Example
- How to check if Java main thread is alive
- How to fix Java nio NoSuchFileException wile reading a file
- Java 8+ get Day of the Week Examples with LocalDateTime, DateTime, ZonalDateTime and Instant classes
- Ways to Convert Integer or int to Long in Java
- [Java] How to throws Exception using Functional Interface and Lambda code
- [Fix] Spring Boot: mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
- Java: The value of the local variable string is not used
- Java JDBC: Insert Java 8 LocalDate and Time using PreparedStatement
- Reduce the size of Tabs on Notepad++ - NotepadPlusPlus
- Accept Only 0-9 Numbers RegEx Example - HowTos
- Have you noticed MacOS Ventura About this Mac look like Mac OS X - Mac-OS-X
- Word count in Notepad++ - NotepadPlusPlus
- Setting up Spring Boot 3 + Maven + MySQL + JDBC Example - Java
- How to change SharePoint Online site collection or subsite URL address - SharePoint
- Fix Error - Another active Homebrew update process is already in progress - MacOS
- How to delete SharePoint Online List Item using REST API - SharePoint