oracle / javavscode

Java platform support for Visual Studio Code for full featured Java development (edit-compile-debug & test cycle)
Apache License 2.0
224 stars 26 forks source link

Wrong version of Gradle used #190

Closed hrstoyanov closed 1 month ago

hrstoyanov commented 3 months ago

I have a fully configured Gradle projects witjh Java 22.0.1 and Gradle 8.8. When I open it with this plugin, I get this error:

Project webapp: Unsupported Java Runtime: The Java version: 22, that is selected for the project is not supported by Gradle 8.6.The IDE will attempt to use Gradle 8.6 to gather the project information. Possible solutions: * Upgrade your Gradle version on your project * Select Java Runtime 21 (or below), on Build > Gradle Execution settings, to avoid this problem!

Apparently there is some Gradle 8.6 bundled and this plugin fails to read my project's /gradle folder where there is a gradle-wrapper.properties file which clearly specify the Gradle version used (8.8 in my case), as well as the gradle-wrapper.jar fie itself.

Also, the instruction in the popup makes little sense - I tried Command+Shift+P (MacOs) but there is no "Gradle Execution settings"?

Achal1607 commented 3 months ago

Hey @hrstoyanov, Are you still facing this issue? I tried to create a gradle project and tried to reproduce this but was unable to do it.

hrstoyanov commented 3 months ago

yes, when I open a folder with Gradle build file, this plugin offers to initialize and then the popups happen:

Screenshot 2024-07-04 at 4 17 32 PM

... So it looks like initializing a Gradle project always happens first with the built into the netbeans language server Gradle engine, which is way behind compared with the current Gradle distribution, hence the issues with Java 22