Hot code replace (HCR) is a debugging technique whereby the Eclipse Java debugger transmits new class files over the debugging channel to another JVM.
Make sure your application server JRE and Eclipse JRE version should be same or else it will throw unsupported class version and hot code debug will not work. Sagar Borkhatariya is a new contributor to this site.
If you debug this class in Eclipse, you can make changes to it, on the fly, without restarting the JVM. For example, try setting a breakpoint on the second line of blah (). Next, change the literal blah to quz. Save the file and the program will continue running with the new code.
If the problem only happens in Eclipse, then it’s probably a server.xml configuration problem. Check your tmp0/conf/server.xml file’s <Context> element; check the path attribute. The path attribute indicates the virtual directory of your webapp.
You need to have your "Build Automatically" enabled/ticked in eclipse for eclipse to be able to hot swap the code.
Click on Project-->Check "Build Automatically". Start a debugging session and saved changes will be hot swaped.
To be able to see those warnings go to Debug settings(In preferences go to Debug settings) in eclipse and you will see "Hot Code Replace" options to enable/disable warnings shown to the user.
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