25

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?

Gama11
  • 31,714
  • 9
  • 78
  • 100
kr15hna
  • 529
  • 1
  • 5
  • 12
  • 1
    Please provide more information about your project. I mean Web/Desktop, build system name (Maven, Gradle). For instance in web projects you can setup a hotswap to a frame deactivation hook."Run/Debug Configurations"->"Your Configuration Name"->"Server (tab)"->"On frame deactivation" set it to "Hot Swap classes". And every time, when window will be switched from Idea to other (browser for instance), changes will be reloaded immediately. – Taras Sep 21 '15 at 10:00
  • @Taras my project is Desktop , Gradle , libGDX framework – kr15hna Sep 23 '15 at 17:53
  • CTRL+SHIFT+A find registry compiler.automake.trigger.delay=500---According to ur requirement – Priyanshu Singh May 07 '18 at 02:52

3 Answers3

14

To reload changed classes

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

Refer this link for detailed explanation.

cambunctious
  • 8,391
  • 5
  • 34
  • 53
RockAndRoll
  • 2,247
  • 2
  • 16
  • 35
  • 4
    as i said i am reloading changed classes but this takes a lot of time, while eclipse takes no time at all(i tested it for the same project). What i want to know is that whether is there any other faster way to do in intellij. thanks for your effort:) – kr15hna Sep 23 '15 at 17:55
  • 2
    in the new IntelliJ Idea you can find Reload Changed Classes under Run -> Debugging Actions -> Reload Changed Classes – michal.jakubeczy Jul 29 '20 at 08:35
  • I can't find the Reload Changed Classes dialog box. Was that removed? – cambunctious Nov 06 '20 at 18:26
4

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

Gama11
  • 31,714
  • 9
  • 78
  • 100
Priyanshu Singh
  • 704
  • 8
  • 12
1
  1. Ctrl+Shift+A
  2. type rcc (or "recompile changed classes")
  3. Hit enter

next time you dont need to type, it will give the last run action

Eboubaker
  • 618
  • 7
  • 15