Anatoliy Kmetyuk Anatoliy Kmetyuk - 5 months ago 193
Java Question

How to disable Gradle daemon in IntelliJ Idea?

I need to disable the Gradle daemon in IntelliJ Idea, because somehow Scala plugin is not working with the daemon (the compilation fails with

NullPointerException
).
I have tried to edit my IntelliJ Gradle build configurations to include a JVM system parameter
-Dorg.gradle.daemon=false
:

enter image description here

Also I've tried to use
--no-daemon
flag at the same place (Script parameters and VM options). Also I've tried to specify these options in the
Preferences -> Gradle
menu of IntelliJ. None of these attempts gave any result, the daemon continue to start, so I have to kill it before
running/compiling
for the second time.

enter image description here

Neither disabling daemon explicit in
~/.gradle/gradle.properties
according to https://docs.gradle.org/current/userguide/gradle_daemon.html#N10473 doesn't have any effect.

How can I disable the Gradle daemon usage in IntelliJ Idea?

Answer

IntelliJ interacts with Gradle via the Gradle tooling API, which always uses the daemon. i.e. There is no way to turn it off.

What you could do (after filing a bug report) is not to use the IntelliJ Gradle integration but instead generate IntelliJ project files with gradle idea.