Over the years, upcoming Java features have always been a point of excitement throughout the community. Promises of vast performance improvements, less memory usage, and more stable tick rates. This article explores the upcoming Java features, estimates of when they’ll likely arrive, and how they’re likely to affect Minecraft and servers. This article is for both users and developers, so I'll skip over the finer technical details to make it more understandable. In saying that, I will use some technical terms with explanations when necessary. This article also does not touch on developer-specific features that won’t affect how Minecraft runs. While they may make it easier for developers to make mods and plugins, that’s not what this article is about.
As Mojang has started updating to newer Java versions much faster in the coming years, and that historic information is still useful to those running older versions of Minecraft on older Java versions, this article is split into two sections. Upcoming changes, and changes that were previously listed in the upcoming changes section of this article prior to Mojang bumping their recommended Java version.
As of writing, Mojang officially recommends Java 21. Based on their trajectory and apparent preference to only update to Java versions with an official Microsoft OpenJDK release, the most likely next release for them to upgrade to would be Java 25, sometime after its release in late 2025.
Upcoming Features
Garbage Collector Improvements
The most impactful short-term impacts to Minecraft are changes to the garbage collector. A garbage collector is a system that cleans up any memory that the application is no longer using. While it may seem simple, these are very time-intensive and complicated pieces of code. With every Java release, there are improvements to the included garbage collectors.
While there is no single giant feature coming in the near future, every single Java release makes improvements in this area. Garbage collector improvements stabilize performance, reduce memory usage, and overall, just make the game feel like it’s performing better. As these don’t require any code changes to the application, you can even try these out before Mojang officially upgrades their recommended Java version. If newer Java versions exist, beyond those recommended by Minecraft, it might be worth testing those out, you might just find that they perform better.
Project Valhalla (Inline / Value types)
Project Valhalla has become a common name through some areas of the Minecraft server community, with claims that it'll significantly improve the performance of Minecraft. The main feature of Valhalla that'll impact Minecraft is Value Classes.
Currently, the Minecraft codebase is full of containers of memory that store smaller values inside of them. For example, a block contains numerous pieces of information, such as the type, properties, etc. If you visualize a block as a container, it would currently look like a container full of little notes telling you what other container to find that piece of data in. This means to get the type and properties; you end up having to find and look through multiple containers. Value classes flatten this structure, allowing the one container to just store the data itself. This change leads to less memory usage, quicker memory access, and less work for the garbage collectors.
While value classes likely won't be a "game-changing" improvement, this likely will allow for noticeable improvements across the board, and some significant reductions in garbage collector performance impact. Like most of these Java changes, however, this requires Mojang to put in time to adapt the code to use value classes where appropriate. Valhalla is likely the most significant feature coming to Java in the future from the perspective of Minecraft; however, don't expect it anytime soon. Adding value classes to Java requires a fundamental change to the way it works, as well as ensuring that it doesn't break any previous behavior. While they’re closer now than ever, it’ll likely still go through years of testing before it becomes a stable feature for general use.
Previously upcoming features
Garbage Collector Improvements
G1GC
As of Java 9, a newer garbage collector known as the G1 Garbage Collector has been the default. While available in Java 8, it wasn't the default. This garbage collector performs significantly better with Minecraft than the old default, and even more so with improvements made since. The improved garbage collector is one of the main reasons many servers use Java 11 over Java 8. Members of the Minecraft server community, such as Aikar, have also done a fantastic job of tweaking the G1 garbage collector and documenting their findings.
Shenandoah and ZGC
G1 isn't the only new garbage collector. Both Shenandoah and ZGC have come about in recent versions of Java and boast rather impressive performance stats. While both of these appear to run faster than G1 in general use cases, they have not been heavily researched or tested on Minecraft servers. Due to this, using G1GC with Aikar's tweaks is likely a better idea unless you wish to perform some experimentation. Shenandoah is significantly more likely to be a better garbage collector for Minecraft than ZGC, however, as it is more optimised for the kind of memory output that Minecraft creates.
Project Panama (Native Access) – Arrived in Java 19
Project Panama aims to improve the way Java applications access lower-level aspects of the machine. In software such as Minecraft, these low-level accesses generally refer to networking hardware or graphics cards. Most of Panama's contents will arrive as preview features in Java 16, to hopefully receive full release shortly after.
Libraries
This project will not directly impact Minecraft, but some of the game's dependencies can improve performance by utilizing Panama. The most significant benefit is on the client, where the rendering library the game uses (LWJGL) can make use of Panama to improve performance. While it’s uncertain how much of a performance gain this would make, it’ll likely be noticeable. The networking library in the game (Netty) will also likely see a minor improvement, as Java will be able to optimize the code better. As the affected part of the network code in the game is not slow, this will likely not be too noticeable. As these changes must be implemented by the libraries rather than Minecraft, they won’t necessarily happen when Mojang upgrades their Java version. LWJGL for example, is intending to also wait for project Valhalla before adopting this.
Proxy Software
One area where Panama is likely to have a significant impact outside of Minecraft, is server proxy software. Server proxy software spend almost all their time handling network requests, so a version of Netty that makes use of Panama could theoretically handle significantly higher player loads per proxy. Given the recent trend of layering proxies, this could reduce the operating costs of large Minecraft networks.
Project Loom (Virtual Threads) – Arrived in Java 21
One of the Java changes likely to come out sooner rather than later are virtual threads with Project Loom. This feature provides a fast and straightforward way to make small tasks asynchronous or multithreaded.
While this will not allow the game to be entirely multithreaded like some claim, it may improve performance and simplicity of some areas that are already heavily multithreaded such as lighting, networking, or chunk loading (on Paper).
Another massive bonus is that it will hopefully make it easier for programmers to do the correct thing when writing asynchronous or multithreaded code. This change may mean that more beginner programmers will write plugins for servers that properly use threading and asynchronous code, especially in a safer manner.
Recent information indicates that this feature could land as a preview as early as Java 17, but it will likely be a release or two later before it becomes stable. Overall, this feature will not improve much, but if the game is changed to make proper use of it, there may be some minor performance improvements.
Conclusion
The future of Java contains some exciting changes, and some can improve Minecraft for the better. However, most of these improvements depend on Mojang updating to a new version of Java and making changes to the game's code. Hopefully, at some point, the potential benefits outweigh the time commitment, and Mojang dedicates the time to achieve this.

Hi, I'm Maddy Miller, a Senior Software Engineer at Clipchamp at Microsoft. In my spare time I love writing articles, and I also develop the Minecraft mods WorldEdit, WorldGuard, and CraftBook. My opinions are my own and do not represent those of my employer in any capacity. Find out more.