Gradle / IntelliJ miscommunication causing "Unable to start daemon process"
Asked Answered
K

1

6

My IntelliJ Idea projects have been working fine until I cloned a new project from our repo and installed Gradle.

This new project runs, but running the debugger causes the following error:

gradle error

I've completed the steps recommended in this similar SO question. I have also read the Gradle Daemon guide.

Some helpful information:

-Gradle does respond to command line prompts, including --profile and --status:

enter image description here

-The project builds and executes; the problem is only the debugger. Is this a mapping issue between IntelliJ and Gradle?

-In the Settings menu, Gradle JVM: is set to "Use Project JDK (Java version "1.8.0_211") and this program is written in Java 8. Delegate settings set to: Build and run using intelliJ IDEA. Run tests using IntelliJ IDEA. Should these change to Gradle?

-I took the advice of one of the respondents and had one of our IT guys check out my ports and firewall settings. He was unable to solve the problem and said the issue is with Gradle.

So far, nothing has worked. What should I do?

Kileykilgore answered 25/10, 2019 at 19:59 Comment(3)
although I don't really have the ability to alter my firewall, as it's a company firewall this is likely the cause. See the error: connection refused - Java debugger failed to open tcp connection on your localhost b/c connection was refused. Try with antivirus/firewall disabled or make sure that IDE settings directories IDE executable, IDE installation home are excluded from the scan.Pistoleer
@Pistoleer thank you for the suggestion. Is it likely a firewall issue, given that the debugger works in my other programs? (The connection is not refused)Kileykilgore
Addendum: my other projects do not use Gradle, so the connection refused issue may be exclusively a Gradle issue.Kileykilgore
K
1

I solved this problem after some tinkering:

In (IntelliJ) File > Settings > Build, Execution, Deployment > Gradle, I changed "Use gradle 'wrapper' task configuration" to "Use local gradle distribution."

Gradle settings

Also, notice in this screenshot that "Gradle VM options" has a custom value; this was suggested as a solution in another post. This relates to memory management, as some people speculated that the daemon was crashing because of a RAM issue. My solution appears to work regardless of whether I alter that value.

Kileykilgore answered 31/10, 2019 at 18:57 Comment(4)
This may be an old answer but the problem does persist and i can say one reason why in latest intellij CE i was facing same. You should check your jdk and make sure you're not using zulu 11**. If you can make it openjdk that will be compatible with your gradle. Good luck :)Stagner
Thank you very much @Stagner , also applies same to zulu8***Hokkaido
I have the same issue and tried to use your solution, but the menu is not available in IntelliJ IDEA 2022.2.1 . Any idea on how could this be solved on the current version of IntelliJ?Yorkshire
@Yorkshire the option is below "Build, Execution, Deployment" > "Gradle" > "Gradle projects" > {your project} > "Gradle" > "Distribution" list.Opposite

© 2022 - 2024 — McMap. All rights reserved.