Oracle logo
– Getty Images

As if Java wasn't already functional enough, here comes news that it's now able to scale out software even faster and more efficiently than previously. After all, Java – now 28 years old – is being used in just about every device on Earth in some fashion, so one could confidently call that "scalable."

But there's always room for improvement. At Oracle CloudWorld, the Java team unveiled a list of key new features in Java 21, which went into general availability last week.

First up: Virtual threads

"This is a hallmark feature that everyone's been really excited for – virtual threads – which have come out of Project Loom," Georges Saab, SVP of software development in the Java Platform Group at Oracle, told SDxCentral. "And that's basically about taking the already great scalability of Java and taking it to the next level.

"Rather than a one-to-one mapping between platforms, threads, and Java threads, you can now have thousands, or tens of thousands of Java threads, mapping to a lot more threads. And that means that programmers can write a simple, synchronous style of code that's easy to read, easy to write, easy to understand, easy to do, and have that scale really, really well."

What virtual threads can do?

Project Loom brings high-throughput concurrency to the Java Runtime Environment. Virtual threads are its most important feature. So, what's a real-life result of using virtual threads?

"One kind of use case is a transactional system that's doing a lot of I/O," Saab said. "In the past, you might be throttled on the amount of I/O that you're able to do. What people would resort to in past years in order to try to get past that scaling challenge is [to] change their style of programming to reactive or asynchronous programming.

"This can help people solve some of those scaling goals to a limited degree, but at the cost of dramatically more complex, hard-to-understand, and hard-to-debug code. Now they don't have to do that. They can write the really simple, synchronous code they wanted to write in the first place, but now they actually have the runtime scaling for them (the apps)."

Another feature that has been improved is editing out code for obsolete operating systems, Donald Smith, Oracle's VP of product management, told SDxCentral.

"One of the things that we've been doing in Java over the last several years is tagging things for deprecation, and then actually removing them from the platform," Smith said. "For example, in Java 21, the Windows 32-bit x86 core has been tagged for deprecation to be removed in a future release. We don't expect a resurgence of it anytime soon," he said with a smile. "What that allows us to do is keep the codebase as clean and maintainable going forward."

Chad Arimura, Oracle VP of developer relations, said that "one of the best things to happen to Java in recent years is we're at the 12th release of the six-month release cadence."

"Java has now released a new version every six months, which gets innovation into the hands of developers quickly and allows them to try out new things," Arimura explained. "We have preview features that allow them to try things that are almost complete, but they may have some feedback for. That's how we ensure that we continue to deliver on a continual basis to developers rather than having to wait three or four years."

Java, with an estimated 60 million software developers using it frequently, remains a mainstay of development since its introduction at the outset of the internet in 1995.

Oracle, which acquired Java’s originator, Sun Microsystems, in 2010, introduced at the conference the following new set of cloud native capabilities for Java developers, including the full Java Development Kit 21, GraalOS, OCI Functions powered by GraalOS, and Graal Cloud Native 4.0.

  • GraalVM is a 3-year-old alternative Java runtime that works with advanced GraalVM Native Image to enable deployed software to run as native-machine executables. It enables low latency and fast start capability, reduces memory requirements, and improves efficiency by allowing applications to be suspended and resumed.
  • OCI Functions powered by GraalOS is a fully managed, multitenant, highly scalable, on-demand, functions-as-a-service platform. It addresses the issue of slow cold starts by running functions as native executables, providing sub-second startup times. It uses GraalVM Native Image to reduce memory usage by up to 50 percent. It also uses out-of-the-box integrations to improve developer productivity.

Graal Cloud Native 4.0 is a curated set of open source, cloud-native, Micronaut framework modules to help developers take full advantage of cloud services without dependency on proprietary platform APIs. It includes features such as native support for GraalVM Native Image, Kubernetes integration, and distributed tracing.