Change your Java code, hit save, and see the results without restarting your application.
In collaboration with TIZZLE, I've developed Java HotSwap for Zed, an open-source extension that brings automatic Java HotSwap to what has quickly become my favourite code editor, Zed.
It's a relatively simple idea, but one that makes a massive difference when you're actually building software.
The problem
I've recently been developing my own Minecraft-inspired game using Java 25, Gradle and LWJGL.
One of the most frustrating parts of development was having to restart the entire game every time I wanted to test a small change. Something as simple as increasing the explosion radius of an arrow meant stopping the game, rebuilding it, launching it again and getting back to where I was.
Coming from Eclipse, I was used to being able to change Java code while an application was running. When I moved to Zed, I realised that the same automatic HotSwap workflow wasn't readily available.
I really didn't want to switch editors just for that.
So I decided to build a solution.
Introducing Java HotSwap for Zed
Java HotSwap allows you to modify compatible Java code while your application is running.
The workflow is simple:
- Launch your Java application with HotSwap enabled.
- Make a change to an existing method.
- Save the file.
- The extension recompiles and reloads the updated class automatically.
Your application stays running throughout.
For my Minecraft clone, I can now change the behaviour of exploding arrows, save the file and immediately test the new result without ever closing the game.
It's exactly the kind of development experience I wanted when I started using Zed.
Built for more than one project
I didn't want to create something that only worked with my own game.
The extension is designed to support Gradle, Maven and plain Java projects, including projects with multiple modules and builds nested inside larger workspaces.
It uses a Rust companion and a Java instrumentation agent to handle compilation and class reloading, while preserving existing build configurations and application settings.
There are some limitations. Standard Java HotSwap supports changes to existing method implementations, but structural changes such as adding fields or methods generally still require a restart.
The first release has been tested on Java 17, 21 and 25, with further compatibility testing planned.
Open source and what's next
The project is completely open source under the MIT licence.
This is the first working release, and there's still more I want to improve, particularly around compatibility, installation and making the experience as seamless as possible for other Zed users.
I'm also working towards making the extension available through Zed's extension marketplace. For now, it can be installed from the GitHub repository using the development extension workflow.
You can explore the source code, installation instructions and examples here:
Java HotSwap for Zed on GitHub
If you're a Java developer using Zed, I'd be interested to hear what you think. Contributions, bug reports and feedback are always welcome.
This project was developed by me in collaboration with TIZZLE, my digital studio focused on web design, development and custom software.
You can find more of my work at xandertaylor.org.