Can't get auto hotswapping working with a gradle project

Answered

I'm currently using 2018.2.8 Ultimate Edition (I'm too poor to get the latest version) and I can't seem to get hot swapping working in my project  - which builds using gradle. I'm sure I've had it working before, although now I'm wondering if that was only before my subscription expired last August.

If I do Run > Reload Changed Classes then the hotswapping works, but I've got in the settings to do that automatically and it isn't happening. I've tried checking the "Delegate IDE build/run actions to gradle" box, but that doesn't seem to help and only causes a painfully slow build process whenever I change classes.

Is it possible on the version I'm using?

5 comments
Comment actions Permalink

>If I do Run > Reload Changed Classes then the hotswapping works, but I've got in the settings to do that automatically and it isn't happening.

So it works on manual action but does not work on frame activation/deactivation?

What Run/Debug Configuration are you using (please attach screenshot of all tabs)? What is the project type? Please describe your exact actions (what exactly are you changing, how you update etc) when it does not work. Attach idea.log file (Help | Show Log in ... action) after IDE restart and reproducing.

Also try disabling all 3rd plugins you are using and check.

For uploading you can use ftp://ftp.intellij.net/.uploads / https://uploads.services.jetbrains.com or any file sharing service.

0
Comment actions Permalink

Run config:

I have tried building both by simply allowing the IDE to do it automatically and by using CTRL-F9. I've also found it simply works if I use Run > Reload Changed Classes after editing. It does not, as I said, happen automatically. Here are my hotswap settings:

Log file: https://pastebin.com/DR0bQpNA

0
Comment actions Permalink

Seems like you are using Application Run/Debug Configuration. Note that automatic HotSwap (on frame activation/deactivation) does not work for usual Application Run/Debug Configuration (see related feature request: https://youtrack.jetbrains.com/issue/IDEA-158264). It works with Run/Debug Configurations like Spring Boot or Tomcat and other application servers for Java EE applications.

0
Comment actions Permalink

The thing is, I used to have it working if I pressed CTRL-F9 to start a build. For some reason, that doesn't cause it to automatically reload the classes anymore...

0
Comment actions Permalink

HotSwap with delegated to Gradle mode has been implemented since 2019.1 version: https://youtrack.jetbrains.com/issue/IDEA-163187

0

Please sign in to leave a comment.