Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JDK 21 String Templates/Template processors (STR, RAW) #3923

Closed
jackytank opened this issue Jan 20, 2025 · 2 comments
Closed

Support for JDK 21 String Templates/Template processors (STR, RAW) #3923

jackytank opened this issue Jan 20, 2025 · 2 comments
Labels

Comments

@jackytank
Copy link

jackytank commented Jan 20, 2025

Issue

In my VSCode, I had installed the extension Language Support for Java(TM) by Red Hat pre-release version, and my Spring Boot project is using Java 21 so in one of my business logic code I want to use String Templates to concatenate Strings together

Image

in the above image in VSCode it show syntax error when using Template processor STR.

Description

Here is my PC environment info:

  • Java: Temurin-21.0.5+11 (build 21.0.5+11-LTS)

Image

  • Maven: Apache Maven 3.9.9

Image

  • PC:

Image

  • VSCode extension version
    Language Support for Java(TM) by Red Hat v1.39.2025011708 (pre-release)
@rgrunber
Copy link
Member

rgrunber commented Jan 21, 2025

See eclipse-jdt/eclipse.jdt.core#2353, https://bugs.openjdk.org/browse/JDK-8329949 . String Templates were a preview feature in Java 21, 22, and it was removed in Java 23.

Each version of vscode-java can only support the latest set of preview feature. For example, if we support the language preview features for Java 23 (if any), while you can certainly set your target to Java 21, or even 22, you can't also enabled preview features from those releases. Only from the latest one. Normally that would be fine because the feature would be finalized in a later release, but in this case it has been removed, so the result is it's no longer supported.

If you really wanted to work with string templates, you could try vscode-java 1.34.0 as that was the last version to still support Java 22 preview features, which would have included String Templates.

@jackytank
Copy link
Author

See eclipse-jdt/eclipse.jdt.core#2353, https://bugs.openjdk.org/browse/JDK-8329949 . String Templates were a preview feature in Java 21, 22, and it was removed in Java 23.

Each version of vscode-java can only support the latest set of preview feature. For example, if we support the language preview features for Java 23 (if any), while you can certainly set your target to Java 21, or even 22, you can't also enabled preview features from those releases. Only from the latest one. Normally that would be fine because the feature would be finalized in a later release, but in this case it has been removed, so the result is it's no longer supported.

If you really wanted to work with string templates, you could try vscode-java 1.34.0 as that was the last version to still support Java 22 preview features, which would have included String Templates.

ohh sad to hear Java removed it, hope it will comeback soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants