salesforce/bazel-vscode-java

Missing Error Markers, possibly due to _Preview features enabled at an invalid source release level 11, preview can be enabled only at source level 21?_

vorburger opened this issue · 6 comments

When I use this extension for https://github.com/enola-dev/enola/, "Error Markers" are missing - there are no "red squiggles" for syntax errors. However other Java (JDT) features such as e.g. Cross References and Ctrl-Space Completion do work just fine for me.

Perhaps this is related to https://github.com/salesforce/bazel-vscode-java/blob/main/docs/troubleshoot.md#java-version, and the Preview features enabled at an invalid source release level 11, preview can be enabled only at source level 21 error that I'm seeing? I may have been wrong in #74 that this message is "harmless"...

When I'll have a moment, I'll explore installing another JDK and running VSC with that, to see if that solves this.

@guw FYI

OK so closing VSC and doing e.g. killall java && sudo dnf remove "java-17*" && sudo dnf install java-21-openjdk-devel java-21-openjdk-src java-21-openjdk-javadoc java-21-openjdk-javadoc-zip java-21-openjdk-jmods and then restarting VSC and doing a Clean Java Language Server Workspace, as per https://github.com/salesforce/bazel-vscode-java/blob/main/docs/troubleshoot.md#hard-reset, doesn't seem to fix this.

Those Problems are still there, and there is also a pop-up whining about Invalid runtime for JavaSE-17: The path points to a missing or inaccessible folder (/usr/lib/jvm/java-17/).

Invalid runtime for JavaSE-17: The path points to a missing or inaccessible folder (/usr/lib/jvm/java-17/).

vorburger/vorburger-dotfiles-bin-etc@05e7926 and vorburger/vorburger-dotfiles-bin-etc@43ab20a fix this.

I'm toying with upgrading from Java 11 to 21 to see if that could fix this, but it's a PITA; see referenced PRs & issues...

@guw if you can think of a better way to workaround the problem reported here, please do shout.

I'm toying with upgrading from Java 11 to 21 to see if that could fix this, but it's a PITA; see referenced PRs & issues...

https://github.com/enola-dev/enola/pull/426/files has that, and Bazel builds it fine on the CLI...

... in VSC however it's "all red" - even worse than before. Not just on the PR, but even without; see #86.

guw commented

Closing as duplicate of #86

@guw perhaps not a dupe of #86, as I still saw this, even with that.

However with enola-dev/enola#426 (after #86 fix) this goes away!

I'm not entirely sure yet I really can upgrade to Java 21... but may be I will temporarily.

Can you think of a better way to workaround the problem than bumping projects to Java 21?

Also, Troubleshooting needs a related update; I'll send a PR.