Java, the general-purpose, open-source programming language that was developed in 1995 is still going strong. The business-technology landscape has undergone a massive transformation in the last 25 years but the platform has managed to thrive and remain at the heart of modern IT operations. With the emergence of modern workloads in enterprises, Java is continuing to play an important role in the modern application development landscape.
“We’re trying to provide developers with the tools to address the workloads that exist today and that will exist in the future. We’re working on making Java friendlier to containers,” says Aurelio Garcia-Ribeyro, Senior Director of Product Management at Oracle. He is also the Principal Product Manager in charge of Java SE since 2010.
Ideal for modern workloads
One of the things that have changed to ensure Java stays relevant is its runtime. It is also becoming container friendly to stay in tune with the times.
“There was this monolithic Java runtime. We had many applications using and sharing that same runtime, which was why the runtime always had to be complete. Modern applications, on the other hand, are usually not deployed that way. They don’t share a runtime, so why do we need a massive Java runtime that provides capabilities that your applications don’t need,” argues Garcia-Ribeyro.
With the jlink tool, developers can now carve out the pieces of runtime that their application doesn’t require. The tool provides a custom Java runtime image that carries only the platform modules needed for a given application.
“It’s Java as usual, but the runtime is smaller because it’s not shipping along or loading all of the pieces that you are not going to use anyways
When developers give Java byte code to a Java virtual machine, it converts it to machine instructions based on the architecture and the characteristics of the machine on which it’s running. The same byte code, therefore, produces very different machine instructions depending on the machine’s memory and cores.
“We’ve worked to make sure that maybe the hardware has all of that but the container is constrained. So even though the hardware has a bunch of cores, you only get to play with this piece of the set. You can only use this much memory. We’re only always working to improve things like that,” says Garcia-Ribeyro.
According to Garcia-Ribeyro, “Java is the number one development language for the Cloud as well.”
“The characteristics that make Java a very robust and good language for enterprises also allow us to produce something that’s really good for the Cloud as well. Java has been multithreaded from the beginning. It runs in many different environments and isolates you from hardware,” he says.
The Java Development Kit 14 (JDK 14) was released recently. It brings several JEPs (Java Enhancement Proposals) to help developers.
“JDK 14 is another one of the six-month releases that we’ve been producing since the release of JDK 9. It offers a huge list of a hundred plus major enhancements with three or four high-level massive changes that are going to rock everybody’s development world. What we have instead is continuing the pace of innovation,” Garcia-Ribeyro says.
With JDK 14, Java is delivering some of the features that came out from Project Amber. Some new changes will make writing code simpler. This includes things like switch expressions, which was a preview feature in a prior release, but it’s now part of the standard.
Two new previews have been introduced. It makes available records as a preview feature, which is a way of having the Java compiler create for a developer behind the scenes. Then there is a preview for text blocks, which is the ability to write string literals that comprise multiple lines without having to concatenate them by adding plus, line break, and divisions.
Then there are several new tools, one such being the packaging tool.
“It’s a packaging tool that will allow you to package your Java application so that it looks like a native application. With this tool, you can grab your job application and wrap the pieces of the Java runtime that you need plus your application, put all of these in a nice package that looks like a native application for each platform, and distribute that,” Garcia-Ribeyro says.
“We have a new foreign memory access API, which will be the first feature that comes out of project Panama and it’s trying to give you a standard API for doing things that previously people used Sun Misc Unsafe for,” he reveals.
The JFR event streaming enables developers to analyze and monitor Java virtual machines running in real-time.
To keep the momentum of innovation unabated, Java has several projects underway.
Project Panama is aimed at making interactions between native libraries or libraries written in any other language and Java programs easier.
Project Amber is to find places where we can simplify Java language without compromising the readability, while Project Valhalla is trying to find new ways of handling memory.
“It’s always a dangerous proposition for us to try to predict what are the new things coming out. The only thing that’s pretty safe is the things that are now in preview mode. We still continue to work to tighten them up and make sure that they’re ready for the next feature release. We want to deliver these incremental improvements. Every now and then we will deliver something more massive but the total addition of all of these will have a substantial impact,” Garcia-Ribeyro adds.