redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 442 forks source link

If wrapper is disabled, Gradle import should prefer the one on the Path over the embedded one #2372

Open anthonyvdotbe opened 2 years ago

anthonyvdotbe commented 2 years ago

With "java.import.gradle.wrapper.enabled": false, the import prefers the embedded Gradle over the Gradle on the Path. This is counterintuitive and leads to errors: currently the embedded Gradle is 7.1.1, which is unable to import JDK 17 projects. I know that I can set java.import.gradle.home, but that is merely a workaround.

Environment
Steps To Reproduce
  1. have Gradle 7.3.1+ on the Path
  2. set "java.import.gradle.wrapper.enabled": false
  3. import a JDK 17-based Gradle project
Current Result

Fails with an error related to the embedded Gradle

Expected Result

Succeeds because the Gradle on the Path is preferred over the embedded Gradle

CsCherrYY commented 2 years ago

you can set your local Gradle 7.3.1+ to the environment variable GRADLE_HOME, see https://github.com/redhat-developer/vscode-java#supported-vs-code-settings

anthonyvdotbe commented 2 years ago

Currently java.import.gradle.home says:

Use Gradle from the specified local installation directory or GRADLE_HOME [...]

And what I'm proposing is:

Use Gradle from the specified local installation directory or GRADLE_HOME or the Path environment variable [...]