How to modify a running Java application without restarts

Recently, I shared a deep dive into how Spring, Lombok, and Mockito manipulate bytecode from inside the JVM. But I didn’t stop there. The next logical step was to put that knowledge into practice: I built a working example that shows how to modify a running Java application — without restarts, without redeployments, and without touching a single line of the original source code. In my new article, I walk through: ✅ How to attach to a live JVM using the Attach API ✅ How to load a Java agent and gain full access to Instrumentation ✅ How to redefine a method body at runtime ✅ Common pitfalls and practical solutions This isn’t just theory — it’s a fully functional implementation you can run and adapt to your own use cases. After reading both articles — the one on how popular frameworks work under the hood, and this one on dynamic JVM instrumentation — you’ll be able to stop seeing the JVM as a black box. Instead, you’ll start seeing it as a flexible platform that can be programmed from the outside, even while your application is already running. 👉 Full article on TProger (in Russian, with code): https://lnkd.in/epVsA8Rq #Java #JVM #Bytecode #HotSwap #Instrumentation #SoftwareEngineering #ByteBuddy #APM #Performance #Programming

  • graphical user interface, application

To view or add a comment, sign in

Explore content categories