The Future of Java
The future of Java is bright. But with so many planned changes, and a growing list of JDK distributions, it it can be hard to picture what this future may look like.
In this article, we give an overview of the language and platform improvements happening in OpenJDK, what the future looks like for Java technologies, and how the landscape may change with the arrival of new Java LTS versions.
Language and Platform Improvements
As we talk about in depth in this breakdown of the JDK enhancement process, Java as a language is guided forward via a series of JDK enhancement proposals. These proposals range in terms of scope, and are most-often considered to be minor changes by most developers. But some changes, like Lambdas in Java 8, for example, can alter the function and utility of Java in major ways.
How Is Java Changing as a Language?
The easiest way to map how Java is changing as a language and platform is to review the ongoing improvements to the language via JEPs, and to frame them within the larger context of OpenJDK projects.
Project Amber has so far been the primary contributor to language changes under this new release cadence. Language improvements such as Text Blocks, Local-variable type inference and Switch expressions have all come from Project Amber.
Other bigger projects are in the works, bringing both language and API changes with them. Project Panama works to improve how Java works with non-Java APIs while other projects like Project Loom work to improve the language and platform’s asynchronous programming techniques. Project Valhalla, as we look at below, is working on value types for Java.
What Is Project Valhalla?
Project Valhalla is an OpenJDK project led by Brian Goetz. One of the primary focus areas of this project is to explore and incubate advanced JVM features, most notably value types, or inline classes as they are called now. Inline classes “codes like a class, works like an int!”. Meaning data types that are pure value based and without an identity. Java currently has eight such types, the eight primitive types. Every other type in Java is a reference type with an identity. For an in depth look at the current state of Project Valhalla, see Brian Goetz “State of Valhalla."
Inline classes add a lot of possibilities to the language, but the Java mantra of compatibility makes it not a trivial task to implement, and Valhalla has gone through several prototype implementations over the past five years. The lack of identity of inline classes means they can be treated just like a value, and can be copied around, and can be flattened in an array for denser storage and eliminating the reference indirection. Some existing types in Java will likely be converted into inline classes as well, and generics will be expanded to support inline classes, meaning you would finally be able to have a List<int>.
Future JDK Enhancement Projects
While it's hard to predict which JDK enhancement projects will be created and favored in the future, curious developers can often get insight into potential projects via the public mailing lists for OpenJDK.
One recent project up for discussion is Project Leyden. This project by Mark Reinhold from Oracle targets improvements related to performance complaints about Java. Specifically, the project looks at "slow startup time, slow time to peak performance, and large footprint" for Java.
Leyden targets these areas by creating an ahead-of-time compiled static image based on existing JDK components (not GraalVM components) with only the files absolutely necessary for operation. The Project Leyden discussion further outlines the ability to switch between Leyden static images (for JDK), Native Images (for GraalVM) and other conforming static image implementations as they're developed in the future.
While this project may not come to pass as Project Leyden (it could very well be grouped into another project, abandoned, or refocused entirely), it does give a glimpse into how the future of Java is shaped.
The Future of Java Technologies
While it’s hard to predict the next big innovation in Java development and how that will impact the direction of Java as a language, you can certainly trace the impact that big changes in the Java enhancement process have had on dependent technologies.
Reactive Java Technology Changes
Not all changes to Java technologies are innovative in nature. Many of the changes we see in Java technologies are reactive and based on keeping up with the innovations of the language itself. While this is not a new thing – developers have always needed to ensure compatibility with the latest features and releases – the pace of new OpenJDK versions means that technology developers need to be ready to support a new release every six months. And, while it’s not as important for non-LTS versions in terms of missing out on market share, it’s still important.
Innovative Java Technology Changes
Other changes to the Java technology ecosystem can be seismic in nature – impacting technologies across all development languages. With big data, and a 100% polished user experience as the new normal, technology companies are forced to innovate to exceed those demands, or risk becoming irrelevant.
OpenJDK adoption can be a tricky subject for development teams. On one hand, there are new features in newer JDK versions that can help make their applications more efficient and scalable. On the other hand, there’s a large cost associated with updating an application’s code base for migration, and updating to non-LTS version of OpenJDK doesn’t make sense for many teams. As more people leave Java 8, OpenJDK adoption will continue to climb.
What Drives OpenJDK Adoption?
Maybe the largest factor currently driving OpenJDK adoption is the end of free, long term support for Java 8. Free, downstream distributions of JDK 8, like Corretto 8, maintain that support. Paid options like OpenLogic provide continued bug fixes and security patches
Java LTS Versions
The two most recent Java LTS versions are Java 8 and Java 11. The next planned LTS version, JDK 17, is planned to release in September of 2021. According to our recent Java developer survey, previous Java LTS versions in Java 8 and Java 11 account for over 80% of Java users.
Java 8 was the LTS version prior to Java 11. Released in March of 2014, Java 8 accounts for over 58% of respondents to the survey.
Java 11, released in September of 2018, is the latest long term support version for Java. It accounts for just over 22% of surveyed developers.
The next LTS Java version will be Java 17. Java 17 is planned for release in September, 2021.
Other Java Long Term Support Options
While many development teams will migrate their applications to newer Java LTS versions, as support ends for legacy Java versions, there are other Java long term support options.
OpenLogic by Perforce
OpenLogic provides paid support for non-LTS OpenJDK versions, and outdated LTS versions (among many other open-source technologies).
If developers decide to stay with Java SE 8, or another Java SE version, they can retain support and updates for their legacy version of choice for up to 8 years with a Java SE subscription.
Amazon Corretto introduced another approach for LTS. By providing a downstream distribution of Java 8 and Java 11 with free long-term support, Amazon Corretto alleviates some of the financial pain of supporting an outdated JDK. But it still does require a migration, and doesn’t include features that newer versions of the JDK support.
If you're looking for additional info on what the future holds for Java, be sure to check out our recent webinar. It looks at what the future will look like for OpenJDK in 2020 and beyond.
Want to learn more about how Java is changing as a language? Be sure to check out our guide to new features in Java. It covers everything you want to know about the Java enhancement process, notable JEPs, and everything in between.
Use the Latest Java Features With JRebel and XRebel
JRebel and XRebel support the latest OpenJDK and OpenJDK distributions. Try JRebel for free today with a 10-day trial.