I use eclipse (to write, debug ) as an IDE. In debug mode when I make some changes,like initializing a local variable, they are reflected automatically.
But other changes like changing the value of a static variable; sometimes I get a message saying I need to restart the VM and sometimes I don't.
Now the question is what sort of changes are automatically reflected and what doesn't.
I use remote debugging, but will be there any difference when running the program from eclipse?
You're seeing Hotswap in action. It's limited to changing method bodies only. More info here.
It is not the IDE feature, but VM feature of remote debugging. VM now can handle simple changes in logic inside the methods of variable initializers, but can't treat with changed class structure.
The reloading is treated normally, when your class structure doesn't change: you don't remove or add members, methods or inner classes, because adding members or inner classes changes the size of allocated for the class memory. Methods doesn't change the memory size, but changes their structure.
Here you can find some explanations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With