Update to the King of Trendy Tech: JDK13
With the final release candidate for JDK13 having been published on August 22nd and a general release coming September 17th, it’s an exciting time to be a Java developer! All of the new features have been decided on. One of the more notable proposed features, jpackage, was left out in the Initial Release Candidate. It would have allowed us to package self-contained Java applications, but considering the ways Java is used these days, it’s not a surprise it didn’t make the cut.
Looking at the feature set, we have:
Oracle has been focused on improving the lives of developers and guest technologies with this release, by rethinking string representation, handling and readability. Text Blocks introduce a new way to write multi-line string literals, by removing the need for escape sequences. In their path to replacing the old way of writing strings, any new constructs will have the ability to express string sequences.
The feature replaces a different candidate jep(#326): Raw String Literals. Planned as an extension to string literals, the computational requirement for supporting un-escaped delimiters paved the way for Text Blocks and their extended featureset.
Reimplementing the Legacy Socket API:
A new implementation of the legacy socket API, which will bring net.Socket & java.net.ServerSocket to the 21st century. The main reason for this being a straight up overhaul, rather than a simple update are numerous, but the biggest one is the underlying implementation being based on native C and Java, which has been in place since JDK1.0.
As you might know, this has been a major cause for concurrency and reliability issues, which previously blocked portability and made the entire API unreliable, pushing most of us away from it, in search of better implementations. The star of the show are the new lightweight, user-mode threads, aka fibers, further explored in Project Loom, which is built on top of them, with the “purpose of supporting easy-to-use, high-throughput lightweight concurrency and new programming models on the Java platform.”
New switch expressions:
If you’ve been staying up to date with the JDK updates, you’ll recall there was already an update in the last release, with this new one pushing us further towards the proposed pattern matching (aka jep #305).
We will now have the option to yield a value from a switch expression, allowing us the flexibility of using switch as either a statement or an expression, ie allowing case: to fall through, or not, by using case ->. These changes will make for a very happy developer, as we continue to stride the path to the pattern matching proposal.
ZGC: Uncommit Unused Memory:
Continuing on the road of a containerized world, Oracle will finally let our hostage memory free and back to the OS with this update to the crowd favorite Z Garbage Collector. Previously, idle memory was not being released, even if it hasn’t been used by a process for a long time. Initially a reflexive change, meant to bolster the purpose for ZGC being introduced in the first place: good developers doing bad things to the GC, the time has finally come to make ZGC the optimal choice for containerized environments, idling and applications with different heap space requirements.
Dynamic CDS Archives:
Following up from the ZGC update, the application class-data sharing will be updated to add dynamic archiving of classes, at the end of their life cycle. Aiming to finally make itself usable, we won't have to re-run several different configurations, in order to find the best setup for our environment and use case.
With all the changes listed, let’s consider the impact they will have on our favourite Java based projects:
Android developers are looking to benefit the most out of the CDS Archiving changes, by increasing our quality of life. The best part of the change is, static archiving will continue working as intended, not breaking user-made and built-in class loaders.
ElasticSearch and Apache’s Hadoop continue being the breadwinners of modern Java updates, as the language seemingly continues to mold itself against their downsides. With the badly needed ZGC updates, the memory footprint of ES will be drastically reduced. This is a big deal for everyone who uses ES, especially AWS customers, as scalable environments just became cheaper.
Along with improvements that will make the life of the giants easier, we are getting a plethora of changes aimed at the everyday developer. With the introduction of Text Blocks, the update to AppCDS and the new switch expressions. This developer is eager to update the local deployment stack, so he can make full use of these changes, which are bound to smoothen the workflow and fix some very long lasting problems.
Oracle have really been knocking it out of the park this year and JDK13 oozes support for the trendy tech culture of modern developers. In the face of ceaseless jokes about the Java VM being an artefact of a bygone era, the team continues to demonstrate incredible flexibility, supporting its dominant position in the modern world, by bolstering the power of its biggest customers -- the trendy software fullstack.