vscode-gradle
vscode-gradle copied to clipboard
Error running gradle local installation
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.
transferred it from vscode-maven repo since the issue is related to the features of vscode-gradle extension.
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.
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!
BTW, I was recently busy with other work. It would be great if community contribution can be made for this issue.
Still hitting this in 1.96.2 today. @jdneo Is there anyone who could attend to this one-liner fix?
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.
I've submitted a PR for this issue!