Reflections and predictions on how Java will evolve in 2024, by Ihar Novik, Lead Software Engineer at Godel Technologies.

Key Takeaways

  • New LTS JDK 21 and latest LTS adoption within JDK users. Since the release of Java 17, we’ve noticed faster adoption of newer Java versions than we did when Java 11 was released.
  • Since JDK21 was released, Java Virtual Threads has been finalised in the recently released JDK 21, We believe that adoption of this feature will continue to grow as the latest edition of application frameworks, such as SpringBoot, Quarkus, Helidon and Vert.x, have already taken advantage of this.
  • Oracle has committed to evolving the Java language so that students and beginners can more easily learn to write their first “Hello, world!” applications without the need to understand more complex features of the language.
  • Growth of Cloud Native direction: There is increasing community interest in learning about modern cloud-native microservice frameworks, such as Spring Boot, Quarkus, and Jakarta EE. The Spring Modulith project is now an official Spring project and allows the creation of better modular monoliths instead of microservices.
  • Project Galahad, launched late last year, continues to aim to contribute Java-related GraalVM technologies to the OpenJDK Community and prepare them for possible incubation in a JDK mainline release.
  • Adoption of Graal Native Images by Spring project: A Growing interest in Application Startup time/scaling to 0 and fast scaling. As well as the Growth of adoption for Serverless “Lambdas” from the Java side.
  • We may expect Kotlin adoption in the JVM world: probably there wouldn’t be significant changes around Kotlin on the backend but the release of Kotlin Multiplatform will bring new opportunities for the language.
  • The elephant in the room: We see increasing development and application of Generative AI in the Java space, especially for code generation. We also see more development of SDKs or frameworks for AI and ML with Java, like Semantic Kernel, Deeplearning4J, djl, and Tribuo. There’s no doubt AI assistants such as Github Copilot are reshaping the landscape of developer productivity. Moving beyond simple code generators, these assistants are
  • Progressing into comprehensive educators and dedicated collaborators, offering continuous support across the software development journey.

What are the biggest trends in Java you have seen over the past year?

New LTS – JDK21

The round-release model proves efficiency in language development and brings the second breath to Java. With 2 years between LTS releases Java and rolling releases between LTS releases – the model provides flexibility around new features introduction in preview mode / testing it and releasing stable versions.

We can see the growth of JEPs numbers here:

Source: https://advancedweb.hu/a-categorized-list-of-all-java-and-jvm-features-since-jdk-8-to-21/

There are a lot of remarkable language syntax features between those 2 LTS: such as Record Patterns for switch and instance off, Pattern Matching for switch, String Templates improvements and others. There are a lot of new APIs that make developer lives easier: Sequenced Collections, new Foreign Function and Memory API.  You are even able to get performance / Garbage collection improvements just by moving to the new version of Java.

Oracle has committed to evolving the Java language so that students and beginners can more easily learn to write their first “Hello, world!” applications without the need to understand more complex features of the language.

Virtual Threads

There is one feature in JDK21 that has been eventually finalised in this release and that is a real game changer for the entire JVM infrastructure: Java Virtual Threads (as well-known as green threads in other languages). It significantly simplifies the development of multithread programming by synchronously writing asynchronous code with spawning light threads.

We believe that the adoption of this feature will continue to grow as the latest edition of application frameworks, such as SpringBoot, Quarkus, Helidon and Vert.x, have already taken advantage of this. Additionally, we may observe that the rest JVM infrastructure such as Java Servers and libraries have started to adopt Virtual Threads as well.

Java Versions Adoption

Companies are embracing the adoption of the latest supported iterations of Java.

Source: https://www.azul.com/wp-content/uploads/final-2023-state-of-java-report.pdf

We were encouraged by the substantial transition from Java 8 towards the latest LTS versions, notably Java 11 and 17. And expect growing LTS21 adoption within the next LTS cycle. This shift signifies that application teams have likely navigated past the compatibility hurdles introduced in JDK 9, demonstrating their adeptness in upgrading to these more recent versions.

Companies aiming to sidestep Oracle’s commercial license fees must commit to a consistent upgrade cycle, ensuring they remain on the latest LTS (Long-Term Support) release within the complimentary three-year timeframe. Given the two-year cadence for Java LTS releases, organisations have merely a one-year window to execute a complete migration to the succeeding LTS release.

For the same reason, we may observe rising interest in alternative JKD vendors.

Source: https://newrelic.com/resources/report/2023-state-of-the-java-ecosystem

We may see a clear trend for the adoption of free alternative JDK vendors to Oracle distributions. Significant growth was observed from the AWS distribution (not the last place it could come from the growing adoption of clouds).

Cloud Native

Java’s infrastructure takes a direction towards adaptability and scalability and makes it a pivotal language for cloud-native development. With the integration of microservices architectures, Java enables efficient containerization and orchestration, fostering seamless deployment and scalability in cloud environments. The Java ecosystem’s continuous evolution with modern Cloud Native Frameworks.

Source: https://www.azul.com/wp-content/uploads/final-2023-state-of-java-report.pdf

We may figure out that for the last couple of years, there was an attempt to take leadership from new modern frameworks: Quarkus and Micronaut. In our predictions from the previous year, we anticipated similar outcomes. But Spring with new release 6 and SrpingBoot 3 even more strengthened their position on the market. Even SpringBoot before the release of version 3 was catching up in the functionality of Graal Native Images support.

Graal Native Images

The integration of GraalVM’s native image technology into the Java ecosystem marks a significant stride toward optimising Java applications for enhanced performance and reduced resource consumption. By leveraging Graal Native Images, Spring projects can compile Java applications into standalone, executable binaries, resulting in faster startup times and reduced memory overhead. This adoption underscores the commitment of the Spring community to embrace innovative solutions that streamline application deployment and execution in diverse environments.

Growing Interest in Application Startup Time and Scalability to 0

There is a noticeable trend in the Java community towards prioritising application startup time and the ability to scale down to zero resources when inactive. Developers are increasingly focused on reducing the time it takes for applications to initialise and respond to incoming requests, especially in scenarios where resources are dynamically allocated and deallocated to match fluctuating demand. This emphasis on rapid scaling and minimal startup time aligns with the agile nature of modern cloud-native applications, ensuring swift responsiveness and efficient resource utilisation.

GraalVM native image technology speeds up applications to start in a few dozen milliseconds.

Source: Oracle

There is even a new project CRaC / CDS support with Spring Petclinic that allows Spring Boot applications to significantly decrease startup time avoiding AOT compilation restrictions.

Source: https://foojay.io/today/springboot-3-2-crac/

You may notice that even just by simply upgrading your application JDK to the latest LTS.

Serverless Computing

The rise in the adoption of serverless computing models, particularly the use of functions (often termed “Lambdas”) as a service, has seen a noteworthy surge within the Java community. Developers are exploring and embracing the advantages of deploying Java-based functions on serverless platforms. Leveraging Java for serverless “Lambdas” allows developers to focus on writing concise, modular, and reusable code, benefiting from the scalability and cost-efficiency of serverless architectures. This growing interest in serverless computing from the Java side highlights the adaptability of the language and its ecosystem in catering to evolving paradigms of application deployment and execution in cloud environments. We may mark the release of SnapStart support for Java Runtime in AWS Lamdas. However, there are rising adoption of Graal Native Images in this area.

Re-thinking Monolith Architecture

Also, we may figure out a reflection on the current microservice architecture by raising interest in Modular Monolith. A modular monolith architecture retains the advantages of a monolithic structure while incorporating a modular design approach, enabling the compartmentalisation of functionalities within the monolith. This approach promotes easier development, testing, and deployment compared to a full-blown monolith or microservices architecture. By maintaining a unified codebase while allowing for separate modules, a modular monolith simplifies complexity, minimizes communication overhead, and mitigates some of the operational challenges often associated with microservices architectures, offering a middle ground between monoliths and microservices.

This reflection comes with the release of Spring Modulith. Modulith allows developers to build well-structured Spring Boot applications and guides developers in finding and working with application modules driven by the domain.

Kotlin:

We may expect wider Kotlin adoption in JVM world:

The majority of Kotlin developers (66%) use the language for Android and/or server-side applications. However, the share of Kotlin Multiplatform users has shown steady growth over recent years.

Elephant In the Room

We see increasing development and application of Generative AI in the Java space, especially for code generation. We also see more development of SDKs or frameworks for AI and ML with Java, like Semantic Kernel, Deeplearning4J, djl, and Tribuo. There’s no doubt AI assistants such as GitHub Copilot are reshaping the landscape of developer productivity. Moving beyond simple code generators, these assistants are progressing into comprehensive educators and dedicated collaborators, offering continuous support across the software development journey.

Here are our key takeaways on Artificial Intelligence (AI):

  • 77% of developers use ChatGPT, and 46% use GitHub Copilot.
  • 59% of programmers lack trust in AI tools for security reasons, while 42% have expressed ethical concerns about using AI services.
  • 28% informed us that their company’s policy limits the use of AI generative tools, and 19% believe that AI will become hostile to humans.

Source: https://blog.jetbrains.com/team/2023/11/20/the-state-of-developer-ecosystem-2023/

*By the way AI also been used for editing this article (no machine was harmed)

What are your tech predictions for where Java is heading in 2024?

1. We can expect further development of the language syntax and new features that will affect the ease of use of the language. At the same time, performance will improve and modern garbage collectors (GC1/ZGC) will further develop. But the biggest impact we may expect from further Virtual Threads language infrastructure development: One of the remarkable improvements that may expect – Structured Concurrency and Execution service improvements. These improvements will impact developer excellence within all Java infrastructure, including Application Frameworks and Libraries.

2. A surge in the adoption of the most recent Java LTS versions within the business sphere is anticipated. Both Spring6 and SpringBoot3 now mandate Java17 as the foundational JDK. Furthermore, the implementation of Virtual Threads infrastructure will necessitate a transition towards Java21.

3. Businesses will continue to be interested in infrastructure cost reduction through more optimal utilisation of computing power. More and more attention in development will be paid to the possibility of scaling (including to zero) and reducing the startup time of applications. More widespread use of Graal Native Images through application frameworks is expected. We can expect increased interest in serverless architecture not only from the side of cloud providers but also from the business side.

4. The next big deal in Java is Project Valhalla. It represents the next evolutionary leap in the Java language, heralding substantial enhancements in data representation and manipulation. Focused on the introduction of value types, this project promises to revolutionise Java’s memory efficiency and execution speed. By empowering developers with the ability to create lightweight, immutable data types, Valhalla is poised to be the next big innovation in optimising memory usage and bolstering performance within Java applications. And even bring in perspective additional null safety into the language.

5. The fusion of Artificial Intelligence (AI) based on Large Language Models presents significant potential for boosting developers’ productivity. This convergence is poised to equip developers with smarter, more efficient tools such as ChatGPT/ Bard and IDE integration tools such as Github Copilot or AWS Codewisper, enabling them to concentrate on problem-solving and innovation, thus accelerating software development cycles and enhancing overall productivity.