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

Add support for running Java 21 "Unnamed classes and Instance main method" #1444

Closed
fbricon opened this issue Feb 21, 2024 · 2 comments · Fixed by microsoft/java-debug#542
Closed
Assignees

Comments

@fbricon
Copy link
Collaborator

fbricon commented Feb 21, 2024

vscode-java now provides support for Java 21 preview feature Unnamed classes and Instance main method, however, we're missing the Run/Debug codelens on the main() method

Environment
  • Operating System: MacOS 14.3 (23D56)
  • JDK version: 21.0.1 temurin
  • Visual Studio Code version: 1.86.2
  • Java extension version: 1.28.1
  • Java Debugger extension version: 0.56.2024020601 pre-release
Steps To Reproduce
  1. Set Java 21 as the default runtime
  2. Create a hello.java file
  3. Paste this code:
String greeting = "Hello, World!";

void main() {
    System.out.println(greeting);
}
Current Result

No Run/Debug codelenses
Screenshot 2024-02-21 at 10 49 05

Expected Result

Should be able to Run/Debug the class via codelenses either at the top of the file or over the main() method

Additional Informations
@testforstephen
Copy link
Contributor

When trying Java 21 Unnamed classes and Instance main method with the JDT language server, the instance main method works as expected. However, the unnamed classes fail to compile. See the issue eclipse-jdtls/eclipse.jdt.ls#3089.

@fbricon Do we finish the full support for the unnamed classes in jdt language server?

@testforstephen
Copy link
Contributor

closed with microsoft/java-debug#542

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

Successfully merging a pull request may close this issue.

2 participants