Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just saw a video showing how Notch (of Minecraft fame) is debugging and changing Minecraft while it is running. He pauses the game, changes something in the code and then unpauses the game where the change takes immediate effect without the need to restart the program.

How does this work? Which kind of technique is used to achieve this?

share|improve this question
And thus is the extent of Notch's QA process. – DeadMG Feb 16 '12 at 10:58
According to an older Q&A at Stack Overflow, this could be done with JPDA feature that does "HotSwap" Class File Replacement – gnat Aug 30 '13 at 7:56
Lol, also came here after that video. – Ciro Santilli 巴拿馬文件 六四事件 法轮功 Apr 6 at 6:32
up vote 4 down vote accepted

Java can do hot-swapping out of the box. If you use an IDE like Eclipse it will work for changing method-bodies. If you want to apply other code changes you might want to use a tool. JRebel is a product that supports more cases.

I don't want to do marketing for that product, but I personally do not know any other alternative. On the JRebel website there's a nice feature-comparison.

Hope that helps.

share|improve this answer
+1 JRebel is great for "hot coding" outside of an IDE such as Eclipse. – Jalayn Feb 16 '12 at 9:52

It's called hot code replace and allows an IDE to change live running code via the debugging interface. It has been supported by the Sun JVM since Java 1.4.1

However, unless you use the (commercial) JRebel JVM extension, it's limited to changes inside method bodies. If you add/remove methods or classes, or change signatures, you have to restart the JVM.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.