The idea is that you can start a debugging session on a given runtime workbench and change a Java file in your development workbench, and the debugger will replace the code in the receiving VM while it is running. No restart is required, hence the reference to "hot".
The idea is that you can start a debugging session on a given runtime
workbench and change a Java file in your development workbench, and
the debugger will replace the code in the receiving VM while it is
running. No restart is required, hence the reference to "hot".
# 1 楼答案
调试器的功能是在运行时更改应用程序代码。在Eclipse和许多其他流行的IDE中,它是“开箱即用”的。该特性有几个限制:无法更改方法签名、添加/删除类成员等
# 2 楼答案
这被称为hot code replace:
# 3 楼答案
从这条溪流看不出来。Java在某种程度上可以同时实现这两种功能——您可以使用调试器替换JVM加载的类,但有一些限制。还有JRebel,它摆脱了很多限制
# 4 楼答案
如果处于调试模式,则可以在应用程序运行时进行某些更改。它是否有效取决于更改是否为当前加载的代码。例如,您可以在程序不排序时更改排序函数,下次排序时它将使用新代码
# 5 楼答案
有时候。 在调试模式下,eclipse可以在运行的JVM中编译和更改类文件,这称为热代码替换
资料来源:Eclipse Wiki
在某些情况下,这将不起作用,在这种情况下,Eclipse将提示您重新启动。