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

Provide support for Java 21 #2863

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Sep 20, 2023

@fbricon
Copy link
Contributor

fbricon commented Sep 21, 2023

Please add some unnamed classes/ instance main method test cases.

It seems to me completion doesn't work at all in a instance main method example, e.g.:

public void main() {
  Syste|
}

@fbricon
Copy link
Contributor

fbricon commented Sep 21, 2023

the main snippet should now be allowed in an empty class

@fbricon
Copy link
Contributor

fbricon commented Sep 21, 2023

well JEP445 is not supported yet eclipse-jdt/eclipse.jdt.core#1106

*sigh*

@rgrunber rgrunber added this to the End September 2023 milestone Sep 25, 2023
@rgrunber
Copy link
Contributor

Has anyone been able to get String templates ( https://openjdk.org/jeps/430 ) working ? STR doesn't seem to be recognized.

@fbricon
Copy link
Contributor

fbricon commented Sep 26, 2023

All preview features are currently missing eclipse-jdt/eclipse.jdt.core#890

@rgrunber
Copy link
Contributor

Are we ok to merge as-is for releasing by Thursday ? As far as I could tell I was able to configure a Java 21 JVM with this change.

@snjeza
Copy link
Contributor Author

snjeza commented Sep 26, 2023

@rgrunber rgrunber removed this from the End September 2023 milestone Sep 27, 2023
@rgrunber
Copy link
Contributor

After discussion, we've decided to hold off on this for after the 1.28.0 JDT-LS release. Once we release we can adopt the 4.30-I-builds.

@snjeza
Copy link
Contributor Author

snjeza commented Sep 28, 2023

After discussion, we've decided to hold off on this for after the 1.28.0 JDT-LS release. Once we release we can adopt the 4.30-I-builds.

@rgrunber I have updated the PR.

@akurtakov
Copy link
Contributor

So I've uncovered today that ecj actually supports instance main methods (protected void main() in a class)- aka compiles them fine (no restrictions on that) and they are executed just fine on the console via java --enable-preview ClassName.

@rgrunber
Copy link
Contributor

rgrunber commented Oct 6, 2023

The code to programmatically run/debug isn't handled by JDT-LS. It would be under https://github.com/microsoft/java-debug . The only problem I see is that locating the main class is done through the JDT search engine. I think that if the source parser can't recognize an unnamed classes without throwing syntax errors, then it also won't be able to index that content. It would still rely on language support being adopted.

@snjeza It looks like we'll need to manually add commons.codec (required by m2e) to the target platform. It appears to have been removed in https://download.eclipse.org/eclipse/updates/4.30-I-builds/I20230923-1800/plugins/ .

[ERROR] Cannot resolve dependencies of product languageServer.product:
[ERROR]   eclipse-plugin artifact with ID "org.apache.commons.codec" and version matching "0.0.0" was not found in the target platform

@snjeza
Copy link
Contributor Author

snjeza commented Oct 6, 2023

It looks like we'll need to manually add commons.codec (required by m2e) to the target platform. It appears to have been removed in https://download.eclipse.org/eclipse/updates/4.30-I-builds/I20230923-1800/plugins/ .

@rgrunber I have removed it. I have added it from https://download.eclipse.org/eclipse/updates/4.29/

@snjeza
Copy link
Contributor Author

snjeza commented Oct 10, 2023

@rgrunber I have updated the PR.

@snjeza
Copy link
Contributor Author

snjeza commented Oct 10, 2023

test this please

@rgrunber rgrunber removed this from the End October 2023 milestone Oct 16, 2023
@aghasemi
Copy link

All preview features are currently missing eclipse-jdt/eclipse.jdt.core#890

Thanks for the information. Will they be available on the final release?

Signed-off-by: Snjezana Peco <[email protected]>
@rgrunber rgrunber merged commit 99bf976 into eclipse-jdtls:master Nov 1, 2023
4 checks passed
@rgrunber rgrunber added this to the End November 2023 milestone Nov 1, 2023
@rgrunber rgrunber mentioned this pull request Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide support for Java 21
5 participants