Giter Club home page Giter Club logo

Comments (8)

fbricon avatar fbricon commented on June 12, 2024 3

Also documented in https://github.com/redhat-developer/vscode-java/wiki/Enabling-Java-preview-features

from vscode-java.

rgrunber avatar rgrunber commented on June 12, 2024 2

It has always been the case that preview feature support can only be used against the latest supported Java version (ie. 22) by the extension. https://bugs.eclipse.org/bugs/show_bug.cgi?id=549258#c11 also gives an explanation of this (and that to follow the JEP, one cannot allow --enable-preview to work except for the latest supported Java version.

I'm guessing this is just a lot more visible now because Java 21 is LTS. While before, people had no issues with updating to the latest release level to continue the 2nd/3rd/.. preview of feature , or consume it after it graduates to a standard feature, now users might wish to stay on the Java 21 LTS.

from vscode-java.

snjeza avatar snjeza commented on June 12, 2024 1

Is that normal to not use enable preview on 21 for this?

Yes, it is when using VS Code 1.29.0

from vscode-java.

rgrunber avatar rgrunber commented on June 12, 2024

Is your project a Maven/Gradle project ? Does the project target Java 21 while having Java preview features enabled in the build configuration ? Any chance you'd be able to share the project ?

from vscode-java.

bgunduz55 avatar bgunduz55 commented on June 12, 2024

Project is private. Maven project.
Targets Java 21:
image
Also current JAVA_HOME:
image
Preview Features enabled:
image

from vscode-java.

snjeza avatar snjeza commented on June 12, 2024

@bgunduz55 Could you try to set the project target to Java 22?

from vscode-java.

rgrunber avatar rgrunber commented on June 12, 2024

I think you're facing the same issue as eclipse-jdtls/eclipse.jdt.ls#3131 . In 1.29.0, we added support for Java 22, and the --enable-preview flag is only supported for the latest Java version.

As @snjeza just mentioned, if you change the compiler compliance to 22 or leave it as is and remove the --enable-preview flag, does the issue go away ?

from vscode-java.

bgunduz55 avatar bgunduz55 commented on June 12, 2024

Looks, that's the issue. I just tried remove --enable-preview and it worked on latest version.
I'll try changing compiler target version as 22 too, when I'm available.
Thanks for help @rgrunber @snjeza .
Is that normal to not use enable preview on 21 for this?

from vscode-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.