Closed aghasemi closed 1 month ago
It's a known limitation of the upstream compiler used under the hood. See https://github.com/redhat-developer/vscode-java/wiki/Enabling-Java-preview-features for more details.
This is not something we can fix unfortunately.
Thank you for the link. Regarding the implication does it mean that at any point in time, only previewe features of the latest JDK are supported, no matter how I set my runtimes etc.. (wasn't clear in the link).
And, is there a way to find out what was the latest extension version which had ECJ 21 instead of 22?
It's a known limitation of the upstream compiler used under the hood. See https://github.com/redhat-developer/vscode-java/wiki/Enabling-Java-preview-features for more details.
This is not something we can fix unfortunately.
Hello,
I have Java 21 installed on my machine. I have a maven project for which preview features are enabled (
<compilerArgs>--enable-previev</compilerArgs>
in the configuration of the compiler plugin).Previously it worked fine, but now if I try to run a
main
method in the prject by clicking the play button in the UI (orRun
that appears above the method signature), I get the errorPreview features enabled at an invalid source release level 21, preview can be enabled only at source level 22
from the VSCode. The error does not happen when I run maven from the terminal (mvn compile
).Explicitly specifying the runtime in the VSCode settings did not solve the issue. Is there anything else I can do?
Thanks
Environment
Steps To Reproduce
main()
method from the UI.Current Result
Error
Preview features enabled at an invalid source release level 21, preview can be enabled only at source level 22
.Expected Result
Project should build and run as Java 21 is installed on the system
Additional Informations