Debugging in IntelliJ (Reloading changed classes)

左心房为你撑大大i 提交于 2019-12-03 17:02:34

问题


I recently switched from eclipse to IntelliJ. Eclipse's debug launcher used to reload the application instantly, whenever a class was saved. IntelliJ takes more than 10 secs to reload changed classes, which might not be a lot, but it is annoying because I use it so frequently.

How to make IntelliJ reload changed classes faster?


回答1:


To reload changed classes

  1. Do one of the following:

    • On the main menu, choose Run | Reload Changed Classes.
    • On the main menu, choose Build | Compile "class_name" to recompile an altered class during debug.
  2. In the Reload Changed Classes dialog box, confirm reloading. Results are displayed in the Messages tool window.

Refer this link for detailed explanation.




回答2:


InteliJ is not recompiling the code after change in java files and rebuilding

  1. Project > Setting>Build,Execution,Deployment>Compiler>check "build project automatically"

  2. Ctrl+Shift+A find "registry", according to your requirements check the following:

    compiler.automake.allow.when.app.running
    compiler.automake.trigger.delay=500
    
  3. Add devtool in pom.xml:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>
    
  4. Build, If found any probelm while building, saying some jar in not in class path. Just delete the corrupted jar and re-build the project angain after sync with maven libb



来源:https://stackoverflow.com/questions/32692104/debugging-in-intellij-reloading-changed-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!