After several months of development, Oracle has announced that Java 14 is ready and available for download.
The first thing to say is that this release is not LTS, so it will not be supported for a long time, however, it can serve developers to test the new features through their applications.
On the other hand, it must be said that the last stable LTS version is version 11 which meant an adjustment in the language license terms. However, many companies or independent developers have the option to run OpenJDK and mitigate these drawbacks.
So let’s take a look at it.
Oracle Java 14 new features
In general, the list of changes to Java is quite long because it is a technology that can be implemented in many different environments. However, the most striking features of this new version are the following:
- Accounting Currency Format Support “Currency format instances with accounting style, in which the amount is formatted in parentheses in some locales, can be obtained by calling NumberFormat.getCurrencyInstance(Locale) with the “u-cf-account” Unicode locale extension. For example in Locale.US, it will format to “($3.27)” instead of “-$3.27”. This change will bring better data compatibility with accounting applications making the programmer’s job even easier.
- Records (Preview): Java 14 adds a new class
java.lang.Record. A record has a name and a state description. The state description declares the components of the record. Optionally, a record has a body. The important thing about this new feature is that if a class needs an external library like com.myapp.* and in that library, there is a Record type, this program will not compile unless there are changes.
- Removed the Concurrent Mark and Sweep (CMS) Garbage Collector
- Thread Suspend/Resume Are Deprecated for Removal.
- New Method to SAX ContentHandler for Handling XML Declaration. A new method
declarationhas been added to
SAX ContentHandlerto receive notification of the XML declaration. The main consequence of this is the applications can receive the values of version, encoding, and standalone attributes exactly as declared in the input document.
- The Z Garbage Collector (ZGC) is available as an experimental feature in macOS and Windows.
On the other hand, they also warn that the visibility of text in macOS with night mode may not be correct.
With each version, Java gradually seems to remove the stigma of being an obsolete language. We are still a little far from the new LTS version which will be the 17, but we can already see that it will be a great version.
You can download this version from Oracle’s site but under a commercial license or if you prefer the OpenJDK implementation ideal to test these features without license problems.
Please share this post, and join our Telegram channel.