JDK 21 Early Access Release notes

JDK 21 Early Access Release notes

ยท

3 min read

Please note that these are early-access releases and may not be stable. If you encounter any problems, please report them to the OpenJDK bug tracker.

Support for Variant Collations

The JDK now supports multiple collations for a locale. This means that you can specify the type of collation you want to use, such as traditional or modern

Deprecation of GTK2 for Removal

The GTK2 toolkit is reaching its end of life, and support for it in the JDK is being deprecated. This means that you should start using GTK3 instead

Addition of 4 GTS Root CA Certificates

The JDK has been updated to include four new root certificates from Google Trust Services LLC. These certificates can be used to verify the authenticity of websites and other online resources

Improvements to the -XshowSettings Launcher Option

The -XshowSettings launcher option has been improved to include the tzdata version configured with the JDK. This makes it easier to see which version of the tzdata database is being used

Addition of Microsoft Corporation's 2 TLS Root CA Certificates

The JDK has been updated to include two new root certificates from Microsoft Corporation. These certificates can be used to verify the authenticity of websites and other online resources.

Addition of TWCA Root CA Certificate

The JDK has been updated to include a new root certificate from TWCA. This certificate can be used to verify the authenticity of websites and other online resources.

Changes to Swedish Collation Rules

The Swedish collation rules have been modified to reflect the modern sorting for the language. This means that v and w are now sorted alphabetically, and wb, va, and vc are sorted as va, vc, and wb.

Improvements to the Thread.sleep Method

The Thread.sleep method has been improved to allow for sub-millisecond sleeps on POSIX platforms. This means that you can now sleep for a specific number of nanoseconds, rather than just milliseconds.

Removal of the java.compiler System Property

The java.compiler system property has been removed. This property was used to specify the Java compiler to use, but it is no longer necessary. The default compiler will be used instead.

Support for CLDR Version 43

The JDK now supports CLDR Version 43. This means that the JDK locale data has been updated to include new features and improvements.

Removal of the JAR Index Feature

The JAR Index feature has been removed from the JAR file specification. This feature was used to improve the performance of JAR file loading, but it is no longer necessary.

The java.net.http.HttpClient Is Now AutoCloseable

The java.net.http.HttpClient class is now AutoCloseable. This means that you can now close it explicitly, or it will be closed automatically when it goes out of scope.

The java.lang.Compiler Class Has Been Removed

The java.lang.Compiler class has been removed. This class was never implemented, and it is no longer necessary.

Users Now See a Warning Message if They Specify COMPAT or JRE Locale Data

Users now see a warning message if they specify COMPAT or JRE locale data with the java.locale.providers system property and call some locale-sensitive operations. COMPAT has been provided for migration to the CLDR locale data, but it is no longer necessary. Users are encouraged to migrate to the CLDR locale data.

Emoji-related properties introduced in JDK-8303018 can now be used as binary properties in the java.util.regex.Pattern class. One can match characters that have Emoji-related properties with the new p{IsXXX} constructs, e.g.,

Code snippet

Pattern.compile("\p{IsEmoji}").matcher("๐Ÿ‰").matches()

returns true.

Detection for Output File Clashes

A new compiler lint flag output-file-clash enables detection of output file clashes. An output file clash is when the compiler intends to write two different output files, but due to the behavior of the operating system, these files end up being written to the same underlying file.

This usually happens due to case-insensitive filesystems. For example, a class like this would cause two class files to be written to the same file `Test$

Did you find this article valuable?

Support Passionate programmers|Written guide for programmers by becoming a sponsor. Any amount is appreciated!

ย