redhat-developer / vscode-java

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

Gradle 8.6 and 8.7 are unsupported #3648

Closed MommyHeather closed 1 month ago

MommyHeather commented 1 month ago

Gradle 8.6 and 8.7 are unsupported because the langauge server wrongly assumes they require java 8, and don't support anything newer.

Environment
Steps To Reproduce
  1. Attempt to use gradle 8.6 or 8.7.
  2. Observe a variation of the below error message: image
Current Result

The extension refuses to utilise gradle 8.6 or 8.7, believing that there is no java version they support.

Expected Result

The extension should let you properly use gradle 8.6/8.7.

rgrunber commented 1 month ago

I would have thought this was fixed by https://github.com/redhat-developer/vscode-java/issues/3470 . I'll try it out to see.

Just tried it out and it works for me. @jdneo , any ideas ? @MommyHeather do you have a sample project you could share/attach where you're seeing this issue ?

MommyHeather commented 1 month ago

@MommyHeather do you have a sample project you could share/attach where you're seeing this issue ?

Oddly enough, I'm now completely unable to reproduce the issue - it's all configuring as expected.. Not sure what's going on, for me to have encountered the issue even after updating the extension (as I was slightly outdated) but now having nobody able to reproduce it.

With that then, I guess I'll close this as an invalid issue - apologies for the bother.

rgrunber commented 1 month ago

Interesting. I'm pretty sure the dialog you saw comes up when an older version of Gradle is used with a newer JVM for which it doesn't have support, based on https://docs.gradle.org/current/userguide/compatibility.html . So the "Use Java 17 as Gradle JVM" would have been valid but the "Upgrade to Gradle 7.4.2" implies it was detecting a version lower than that. 7.3 is the oldest that would also support Java 17.

Feel free to re-open if you're able to reproduce this consistently.

MommyHeather commented 1 month ago

"Upgrade to Gradle 7.4.2" implies it was detecting a version lower than that.

It does indeed, but it states in the same message that it (correctly) detected 8.7. Sadly using java 17 wasn't an option, as one of the plugins requires 21.

No consistent reproduction across multiple environments, so... My best guess is that the extension didn't properly update for some reason. I did restart my pc for the first time in a few days just recently, so perhaps that reboot fixed it.

rgrunber commented 1 month ago

I just spoke to @fbricon a little while ago and he mentioned issues such as this have come up before. https://github.com/redhat-developer/vscode-java/issues/3283 . We can keep this closed and leave that one open. This is definitely happening, we just need to figure out what's causing the flaky behaviour.