How to enable Intellij hot code swap

前端 未结 8 1487
清歌不尽
清歌不尽 2020-12-22 20:53

Intellij does not seem to be doing basic hot code swap on my installation.

For this code:

public class MainTest {
    public void method1() {
                


        
8条回答
  •  猫巷女王i
    2020-12-22 21:23

    After below modifications and enabling hot swap, a change in a Java file took 1-2 seconds of restart time. (Initial start time is around 7 seconds for me).

    I hope below method helps...


    First, you need to check “Make project automatically” in preferences menu.

    To open preferences menu;

    you can go to top menu and click;

    IntelliJ IDEA -> Preferences

    or you can type below shortcut via keyboard;

    cmd + option + s

    Then, you can check Make project automatically as in below picture;

    Secondly, you need to modify compiler.automake.allow.when.app.running registry setting as true.

    To open registry, you need to click below keyboard shortcut:

    cmd + shift + a

    Type registry as in below picture, select Registry, and hit enter button of keyboard;

    After Registry window opened, type compiler.automake to see compiler.automake.allow.when.app.running option, and check it as in below picture;

    Then, you need to restart IntelliJ to make registry changes work.

提交回复
热议问题