CloudDevelopersDevOpsFeaturedLet's TalkOpen Source

Java 17: New Features And A Smaller Footprint

0

Guest: Chad Arimura
Company: Oracle
Show: Let’s Talk

Java 17 has finally been released and it promises an exciting array of new features and other enticing aspects. Let’s hear what Chad Arimura, the VP of Java Developer Relations at Oracle, has to say about this new iteration.

Arimura is not just a VP of Java Developer Relations, he’s also a Java developer and he’s excited about the latest Java release, which includes standout features like pattern matching for switch and sealed classes being standardized. According to Arimura, “These things are starting to really fit together and gel together to make it so that a Java developer can be more productive, more concise, be able to better model what’s in their head, in the code, and as a consequence of that, there are fewer places for bugs to hide.”

The new Java is also easier to maintain and is more expressive, which makes the language tailored for more modern workloads and applications.

Another focus point of Java 17 is use cases and modernizing how the language is and can be used. With that in mind, Arimura says, “Going from a monolith to a microservice is one of those examples where we’re starting to see many applications be much smaller. So we’re seeing serverless workloads, we’re seeing microservice workloads. And so in response to that the language is becoming more concise. We have records now which can represent and model data as a class, much more concisely than your traditional class can do.”

Arimura also brings up another Java project called Loom. This project aims to make concurrency simple again in the Java programming model. What Loom does, according to Arimura, is “…introduce us to something called virtual threads, which is a way to make massively concurrent applications and do it in a way that’s very simple, observable and you can operationalize that. So these are the ways that we’re looking at where the world is going.”

Another project called Panama is all about machine learning, artificial intelligence, and big data. Panama includes the Z Garbage Collector which can take terabyte heaps and reduce the pause times down to one millisecond. This means developers can work with much larger data sets.

Traditionally, Java has not been the best language for small scripting use cases. To change that, they’ve released something called single file source code programs, which allow developers to automatically compile and run scripts without the compilation step. To clarify, Arimura says, “What that also does is gives us the ability in that Java program to add the shebang format at the top. So that’s essentially the number sign, exclamation mark-shebang. And then you can point it to a JDK that’s running on your machine. And now you can make that Java file, an executable file, and you can just do dot slash and then that Java file, and it automatically uses the local JDK to automatically compile it and run it as a script.”

There are also some exciting announcements coming from the developers. First off, the six-month release cadence is going very well and has allowed the developers to get new features out more quickly. And developers love this new model because they can get their hands on the new features faster. This has also led the developer to choose a 3-year LTS model for long-term support. However, Oracle has decided the next LTS model will be Java 21 (instead of 23), which means there are only 2 years until the next LTS model.

Arimura also adds, “We announced today that you can use the Oracle JDK now, in production, so we’re adding that capability back in for one-year overlap between LTS releases. So that means that you’ll be able to use the Oracle JDK in production, all the way through to the next release LTS, which is 21 and one year beyond. So if your organization wants to take one year to upgrade, you can use the Oracle JDK.”

The summary of the show is written by Jack Wallen


Here is the unedited transcript of the show…

Swapnil Bhartiya: Hi, this is your host Swapnil Bhartiya and welcome to TFiR Let’s Talk. So, Java 17 is here, and to talk more about what’s new in this release we have with us, once again, Chad Arimura, VP of Java developer relations at Oracle. Chad, it’s great to have you back on the show.

Chad Arimura: Swapnil, thanks for having me.

Swapnil Bhartiya: So let’s start with the basics. Tell me what’s new in Java 17.

Chad Arimura: 17 is exciting. I would say what I’m most excited about as a Java developer myself is the language features that are coming. So in 17, we’re seeing pattern matching for switch. We’re seeing sealed classes, being standardized and pattern matching for switch is a preview but you know, what that means is if you think about project Amber, which is all about language level features, things like records, local variable type inference, switch expressions, we’ve seen this progression of Amber releasing features into the JDK ever since I believe 12 or 13. And we’re continuing to move the ball down the field with sealed classes and pattern matching for switch.

So these things are starting to really fit together and gel together to make it so that a Java developer can be more productive, more concise, be able to better model what’s in their head, in the code, and as a consequence of that, there’s less places for bugs to hide. It’s easier to read, it’s easier to maintain. It’s more expressive. And so it’s really making the language kind of tailored for more modern workloads and applications. And that’s just on the project Amber side, I haven’t even mentioned how much is going on behind the scenes in the JVM, project Panama, and I’m also happy to talk about some of that as well, but I’m really excited about the stuff coming at the language level.

Swapnil Bhartiya: Thanks for sharing that. Now, if you look at this release or any of the releases there are two kinds of things, one is that evolution of the project itself. A lot of things evolve, but then suddenly you also add a lot of features, which are breaking… I mean, I would not call them revolutionary, but if I ask you if you can share “Hey, this is something that we are adding and this something is just the evolution curve of the project.”

Chad Arimura: As many developers know we are releasing Java now on a six month release cadence. So, today represents Java 17 and that six months ago in March, we released 16. And six months before that, September, 15. So you can see that there’s a very concise, very, very precise time-based release cadence of six months between versions. And that’s really exciting for a number of reasons, where we’re getting features out much faster into the market so that developers can get their hands on new features.

And also we have this model now to release things into the market to get broader feedback. So for example, the features that I was just talking about with project Amber, many of those came out as a preview before they were finalized. And what that means is the team was confident that it was mostly done. It could have been completely done. We have confidence in it. It’s fully specced and TCK-ed, and we’re really excited about it, but we, there might be some edge cases out there where we could get feedback. And in some cases we do and we change it in kind of small ways, and then one or two releases later, we make it a standard feature of the API or of Java.

And so we’ve seen that with a number of features from Amber, and then also in 17 are some incubator APIs for project Panama. So that’s another way that we’re introducing things out into the public early, but market them as something that’s not quite completed, we’re still experimenting with. So with project Panama, we’re seeing some incubator APIs that, and as a reminder, what project Panama does is really aims to bridge the world between Java code or the Java world, the native world, which is often C and then the hardware world, the Intel arm chip sets.

And so historically we’ve done that through the Java native interface, which tends to be difficult and painstaking to do, but with project Panama, we’re aiming to bridge those worlds, hence the name Panama, and make that much easier for advanced developers to build libraries and frameworks that interface with native code. So if you think native, you’re thinking of machine learning, artificial intelligence, data science, and so once the libraries and frameworks are sort of the ecosystem of those are running on top of Panama, the end to end users can start to do types of machine learning that wasn’t available to Java before. So we’re really excited about where project Panama’s going. And that’s another example of an incubator API in Java 17.

Swapnil Bhartiya: Excellent, thanks for explaining that. You mentioned some use cases, you know that I love use cases. Java has been around for so long. We don’t have to go where it has been used but I am kind of curious to know a bit about new use cases that you are seeing of Java, one. And number two is that, Java has been a monolith, big, giant so what are you doing to cut down on the footprint as well?

Chad Arimura: Yeah, that’s a good question. So when I mention these projects, when I mention Amber and Panama, and I could talk about Loom and Valhalla, these are projects that are part of OpenJDK and the lead engineers and the architects in these projects are thinking about the world, thinking about where things are going, talking to developers and really thinking through what are tomorrow’s challenges going to be for developers and how do we prepare the Java language to address those challenges? And so, for example, what you mentioned, going from a monolith to a microservice is one of those examples where we’re starting to see many applications be much smaller. So we’re seeing serverless workloads we’re seeing microservice workloads. And so in response to that the language is becoming more concise. We have records now which can represent and model data as a class, much more concisely than your traditional class can do.

And so that is really acting as a central point for better modeling the data that’s coming from a service maybe through a JSON API or microservice API. And so all of these pieces start to fit together into where the world is going. So project Loom, for example, is also releasing features over time. And what project Loom aims to do is make it so that we’re making concurrency simple again in the Java programming model. So we have threads, but of course, threads, you get to a certain point and they begin to fall over. So what project Loom does is introduce us to something called virtual threads, which is a way to make massively concurrent applications and do it in a way that’s very simple, observable and you can operationalize that. So these are the ways that we’re looking at where the world is going.

And of course, Panama is all about machine learning, artificial intelligence, big data, ZGC is another one. The Z Garbage Collector, where you can take terabyte heaps, and we’ve gotten the pause times down to I think one millisecond now. I know the goal for a while was 10 milliseconds, but in recent release of ZGC, we I think, have reduced that down to one millisecond pause times. And so terabytes of heaps, people are working with much larger data sets than they used to, and applications are more distributed than ever. So we’ve got JFR or the Java Flight Recorder. So I would say observability, big data, microservices, these are all trends that we’re watching and we’re continuing to progress the language forward without alienating the billions of lines of code that have already been written and are out there, and we want to make sure that they continue to run on the JVM for many years to come.

Swapnil Bhartiya: This could be a tricky question for you, but have you ever come across use case where somebody wants to use Java, but because of this, they’re like, “Hey, I…” I mean it’s the same case for the Linux, right? That’s where there are a lot of Zephyr and all those other smaller projects out there, but there is “Hey, you know what? We should try to tackle that use case also.”

Chad Arimura: Yeah. Actually one does come to mind now that you mention it. So I think Java traditionally has not been the best language for small scripting use cases. So when you want to write a little bash script and you want to run and execute something at the command line, you write that in bash, or maybe you write it in JavaScript because it’s really fast and easy and you can execute it at the command line.

But what we’ve done recently is we’ve released something called single file source code programs. And with that, you can actually, we build in the compilation step so that you can just type Java and then the Java file, and it will automatically compile it and run it without the compilation step, although that happens automatically and you know, that’s one small step. But what that also does is gives us the ability in that Java program to add the shebang format at the top. So that’s essentially the number sign, explanation mark, shebang, and then you can point it to a JDK that’s running on your machine. And now you can make that Java file, an executable file, and you can just do dot slash and then that Java file, and it automatically runs that, uses the local JDK to run that, automatically compiles it and runs it as a script.

So I’ve started to rewrite a lot of the scripts I have using Java because that’s one use case that I’ve really wanted to use that for. And then one other thing I’ll mention is, is JShell, which is the Java Shell, which is a REPL that allows you at the command line to interactively work with Java. So if you’re teaching Java or you’re sitting side by side with a coworker, and you want to just kind of hack something out, you can fire up JShell, type in some scripts, it will actually store the interim results for you automatically. And you can get results back right away without opening up the IDE and starting a project and firing it up on your computer and all that. So we’re releasing tools that enable developers to do more things with Java, and we’ll continue to do that.

Swapnil Bhartiya: But I do look at it as it looks like you’re trying to make it easy for developers to get started with Java. We are seeing another trend since you were earlier talking about trends is low-code, no-code, where we are trying to help companies quickly move without having to invest too much in developing proposals, because especially in the cloud and the word, there are so many new technologies, human resources are limited. How do you see this also as a challenge where you can help companies to get started with Java without having all that in-house expertise in Java?

Chad Arimura: That’s a big question. So, I think there’s a number of things. I think number one, you mentioned some of these trends as you think about low-code, no-code one of the things that emerges from low-code and actually this used to be my world is serverless, and with serverless, I’m going to spare the definition in this video cast. But with serverless, the point is to write less code and to make it automatically work on top of a platform and not have to think about the infrastructure behind it and just have it execute and run.

And so this is a step towards no code and Java, I think with some of the tools that I mentioned before, and with a lot of the directional ways that Java’s going with making a smaller footprint, things like GraalVM as a technology are really exciting. It makes it so that you can run serverless applications much easier. And so serverless is a stepping stone towards no code because it allows developers to do that, to embrace this model and mean it moves Java forward, going hand in hand.

I guess the other thing is just continuing to evolve the language, to make it more concise, make it easier for developers to write, make it easier for developers to learn. It’s still the predominant language that’s being learned around the world in computer engineering and computer science and we definitely want to see that continue, but we want to make it better and easier. So we’re continuing to encourage the education market to move forward to this latest release, 17 from, a lot of them are on eight and 11. And all of these new features, all the things coming out of Amber will continue to make it so that it’s just a delightful language to program in.

So we are watching these trends carefully. Of course, if there’s no code involved, then there’s really no room for any programming language. But I do think that code will continue to be a central point to these kinds of low code solutions.

Swapnil Bhartiya: I believe when we do look at no code or low code, it goes back to the same point of services also. You are not exposed to that code, but someone else is responsible, someone else is. So you are using more or less like a SAS or IES depending on how you see that. But it’s just to make it easier for those businesses to move forward. I mean, that’s a big debate. Like there is a server in serverless, so there is a lot of code in low-code and no-code as well. It just, you are not exposed. You as a developer is not exposed to that. Chad, I think from 17s perspective, we have very good discussion. I understand a lot. I’m sure viewers will get a lot from there. Is there anything else that you want to talk about or you think that we have covered some bases?

Chad Arimura: I do want to mention a couple of announcements that we made. So along with Java 17, we announced today that the LTS model has been going very well. The six month release cadence, we’ve been getting features out into the market every six months and developers love this because they can get things into their hands quickly. But what a lot of developers said is that… We chose three years for the LTS model because that really aligned with the average release time from the previous release model. And it made sense, and it was sort of the lowest hanging fruit to be able to introduce the LTS model for long-term support. And it was 8, 11, 17 and now 17. But what we realized is that developers wanted to get their hands on features earlier than three years. They said, I really love these new features. I love the release cadence, but I don’t want to wait three years for my company to have to go to the next version.

And so one of the things that we are intending to do is, Oracle is going to make the next LTS version, version 21 instead of 23. And so that means there’s two years to the next LTS instead of three and so we believe that’s the sweet spot to get new features into the hands of developers, both at the six month cadence, as well as a two year LTS cadence who are trusting those in larger organizations.

We also believe that it will make the six-month release cadence more palatable because when you spin up a new application in a large organization, you may be just around the corner to the next LTS. So you can start programming today with the latest release, because you know that the LTS is just around the corner as opposed to two and a half years or three years away.

And two other things, we did also announce that many developers told us that they loved and they trusted the Oracle JDK. They were getting a build of Java from the stewards of Java, the team that writes most of the code that goes into the Java platform. We build the Oracle JDK, but we made that available for subscription customers. Or if you wanted to use it in dev and test environments, we also announced today that you can use the Oracle JDK now, in production, so we’re adding that capability back in for one year overlap between LTS releases. So that means that you’ll be able to use for 17, you’ll be able to use the Oracle JDK in production, all the way through to the next release LTS, which is 21 and one year beyond. So if your organization wants to go take one year to upgrade, you can use the Oracle JDK.

So that’s the second announcement. We’ve heard a lot of excitement about that already. And then the third announcement is dev.java. It’s a new website for Java developers who want to go and get all of the information they want, learning materials, tutorials, a Java playground, a place to download Java, a place to get information about all the different community programs, how to get involved with Java, how to contribute back. We really wanted to bring that back to the Java ecosystem and so we are launching dev.java today, and that’s the whole URL dev.java. And we’re adding that to our lineup of websites, in addition to inside.java, which aggregates content produced by the Java team. So that’s a whirlwind tour of the additional announcements that we made today. And we’re really excited about each of those.

Swapnil Bhartiya: I would just go back to LTS quickly, so the release will be every two years. How long will you be supporting each release?

Chad Arimura: The same as before. So it’s the Oracle five plus three. So, we’re doing the eight year support for LTS releases and that’s not changing. We are just adding on the support for each additional… In two years, we’re adding in another LTS instead of three years from now.

Swapnil Bhartiya: Chad, thank you so much for taking time out today and talk about Java 17 and sharing some of the use cases that are already there, and some of the use cases there you’re still eyeing. Thanks for those insights and I would love to have you back on the show. Maybe not when Java 17 is, sorry, Java 18 is out, but before that, so thank you.

Chad Arimura: Awesome. Thank you Swapnil, appreciate it.

Don't miss out great stories, subscribe to our newsletter.

Login/Sign up