Sergey Nivens - Fotolia

Oracle delivers Java 16 to developers

Oracle has released Java 16, the latest version of the Java Development Kit (JDK) for developers. The company also moved the OpenJDK source code repositories from Mercurial to Git.

Oracle has made Java 16, also known as Oracle Java Development Kit 16, generally available, including 17 new enhancements to the platform aimed at further improving developer productivity.

This latest release is the last one before Oracle delivers JDK 17, which will be a long-term support (LTS) release. That means Oracle will support the next release for a minimum of three years.

Meanwhile, as an interim release Java 16 contains new features such as the Packaging Tool or jpackage, a new tool for packaging self-contained Java applications.

Other new features include the completed versions of the Pattern Matching for instanceof and Records language enhancements that were first previewed in Java 14. Pattern Matching for instanceof enhances Java with pattern matching for the instanceof operator.

Java Record enhances Java with records, which are classes that act as transparent carriers for immutable data. These features were finalized in JDK 16 after a year of community feedback based on real-world applications.

In addition, there are three new incubating features in Java 16: The Vector API, the Foreign Linker API and the Foreign-Memory Access API, as well as one preview feature, Sealed Classes. These enhance Java with sealed classes and interfaces, which restrict other classes, or interfaces may extend or implement them, said Georges Saab, vice president of development in the Java platform group at Oracle.

Java's release cadence

Oracle delivers Java updates every six months to provide developers with a predictable release schedule.

Georges Saab, vice president of development, Java platform group, OracleGeorges Saab

"One of the goals that we had with the six-month release cadence was really making it easier for the ecosystem to adjust to new releases more quickly," Saab said. "And having early access builds available during the development of each of these releases has helped."

Saab said Oracle also has added some "increased goodness" to the Java Virtual Machine by implementing the Elastic Metaspace feature, as well as concurrent thread-stack processing with the Z Garbage Collector (ZGC).

Elastic Metaspace returns unused HotSpot class-metadata or metaspace memory to the operating system quickly, reduces the metaspace footprint and simplifies the metaspace code, which cuts down on maintenance costs. ZGC Concurrent Thread-Stack Processing eliminates bottlenecks to allow for concurrent stack processing.

"The libraries are improving as well, both with improvements to Unix-domain socket channels and the packaging tool, which is sort of the way that Java applications that need to be distributed will be achieved in the future," Saab said.

"It's really about cleanup and helping people," he added. "We want to make sure that their applications and their libraries are resilient to the increased pace of evolution of the JDK."

A key innovation for Java 16 is the Vector API, said one longtime Java market observer.

"Oracle keeps pushing out innovations for Java, even on a short-term supported release like Java 16," said Holger Mueller, an analyst at Constellation Research, in Monte Vista, Calif.

Regarding the Vector API, Oracle provides an incubator module, jdk.incubator.vector, to express vector computations that compile at runtime to optimal vector hardware instructions on supported CPU architectures.

"While under the hood the Vector API is the biggest innovation, the one noticed the most will be the move of the code repository to Git and respectively to GitHub," Mueller said.

"That's an important step to bring the Java community to the latest of open source code repositories," Mueller said. "C++ developers will be thrilled to see their code assets becoming first-class citizens in Java as well."

Mercurial and Git are both open source and were first released in April 2005.

"Back then, Mercurial had an edge, because it worked, made sense to people who were used to traditional SCM [source code management] [systems], and was more stable," said Cameron Purdy, CEO of xqiz.it, in Lexington, Mass., and former senior vice president of development at Oracle. "But Git quickly overtook it, and now easily has a few orders of magnitude with more developers using it."

"The Java team didn't want to keep fighting a pointless uphill battle on their choice of SCM, when almost all developers know and use Git already, and only a small number know and use Mercurial," Purdy added. "So, adding support for Git to the OpenJDK project was a no-brainer."

Oracle's Project Skara to move repositories from Mercurial to Git went smoothly, Saab said.

"We definitely have seen that it's made things more accessible, I would say, to a new audience or a wider audience of developers who were kind of interested in seeing what's going on in the development of OpenJDK," he said.

When the move was first suggested a few years ago, a lot of developers were apprehensive about what it would mean, both to the capabilities they had and whether it would force changes in the way that OpenJDK development was done. But the transition has been easy, Saab said. Thus, Oracle migrated the OpenJDK community's source code repositories from Mercurial to Git and they will reside on GitHub.

GraalVM for free

In addition, Java 16 Oracle has added its GraalVM Enterprise high-performance runtime for Java to the Java SE Subscription at no additional cost, said Manish Gupta, vice president of marketing for Java and GraalVM.

GraalVM makes more low-level things possible to do without ever leaving the comforts of the Java platform. In the GraalVM case, Oracle is moving toward the runtime compiler being largely built in, and driven from Java, Purdy said. At the moment, the maturity isn't there to make this the core default approach for the Java platform, but it will mature and uncouple adaptive compilation from the underlying runtime system itself.

Continuing to bulk up the Java platform offering will pay long-term dividends for Oracle.
Cameron PurdyCEO, xqiz.it

"Eventually, this means that Java developers will be able to play with hardware-level optimizations without ever leaving the comfort of their Java code, and organizations -- like cloud providers -- will be able to sculpt the code that Java is generating in ways that are tailored to their cloud environments, both from a resource utilization and from a manageability point of view," he said.

The Java SE subscription has been running for three years and Oracle has signed on thousands of customers.

The bottom line is no one pays for a language, and almost no one will pay for a language runtime. But companies using your language and your language runtime may eventually be willing to pay for support and access to security patches for long-since-unsupported versions.

"Especially if those are coming from an organization with a well-established enterprise sales team, like Oracle," Purdy said. "So, continuing to bulk up the Java platform offering will pay long-term dividends for Oracle."

Dig Deeper on Core Java APIs and programming techniques

App Architecture
Software Quality
Cloud Computing
Security
SearchAWS
Close