vscode-gradle icon indicating copy to clipboard operation
vscode-gradle copied to clipboard

Error running gradle local installation

Open nonicknamelala opened this issue 1 year ago • 4 comments
trafficstars

I set up Gradle home and disabled gradle.wrapper in vscode settings like below:

"java.import.gradle.home": "C:\ktapp\gradle", "java.import.gradle.user.home": "C:\ktapp\repo\gradle", "java.import.gradle.wrapper.enabled": false, "java.import.gradle.java.home": "C:\ktapp\jdk",

The Gradle Springboot project could be loaded successffly, and most of the gradle functions work well except for below two:

1, error message prompt while clicking "GRADLE DAEMONS" the Gradle plugin from the left bar.

++++++++Error Message++++++++ Error running gradle local installation: Command failed: "C:\ktapp\gradle" "--status" "quiet" '"C:\ktapp\gradle"' is not recognized as an internal or external command, operable program or batch file. +++++++++++++++++++++++++

If I clear gradle.home and enable gradle.wrapper, then the Gradle program could be downloaded to gradle.user.home and the Gradle daemons would be shown.

2, The Java class could not be compiled automatically, I'm not sure whether it is a bug, I have to run compile or build task every time. It is a little inconvenient.

nonicknamelala avatar Oct 06 '24 11:10 nonicknamelala

transferred it from vscode-maven repo since the issue is related to the features of vscode-gradle extension.

testforstephen avatar Oct 08 '24 03:10 testforstephen

Root cause is here: https://github.com/microsoft/vscode-gradle/blob/9ac3ffecdda84a52e6ae1c2bffed7be2f7ef47df/extension/src/views/gradleDaemons/services/GradleLocalInstallation.ts#L19

Should find the gradle executable from the gradle home folder instead of directly using it.

jdneo avatar Oct 08 '24 04:10 jdneo

Root cause is here:

https://github.com/microsoft/vscode-gradle/blob/9ac3ffecdda84a52e6ae1c2bffed7be2f7ef47df/extension/src/views/gradleDaemons/services/GradleLocalInstallation.ts#L19

Should find the gradle executable from the gradle home folder instead of directly using it.

yes, thank you!

nonicknamelala avatar Oct 08 '24 09:10 nonicknamelala

BTW, I was recently busy with other work. It would be great if community contribution can be made for this issue.

jdneo avatar Oct 09 '24 00:10 jdneo

Still hitting this in 1.96.2 today. @jdneo Is there anyone who could attend to this one-liner fix?

tcfurrer avatar Apr 01 '25 19:04 tcfurrer

It's happening to me as well today out of the blue. "If I clear gradle.home and enable gradle.wrapper, then the Gradle program could be downloaded to gradle.user.home and the Gradle daemons would be shown." => this works for me though I do get the warning:

"Error running gradle wrapper: Command failed: "/pathtoworkspace/ProjectName/gradlew" "--status" "quiet" sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required"

Fix would be great.

epaga avatar Jun 17 '25 09:06 epaga

I've submitted a PR for this issue!

cnaples79 avatar Sep 15 '25 12:09 cnaples79