When i run my HelloWorld, it returns:
"java.lang.UnsupportedClassVersionError: HelloWorld has been compiled by a more recent version of the Java Runtime (class file version 52.65535), this version of the Java Runtime only recognizes class file versions up to 52.0 "
How do I solve this problem?
public class HelloWorld{
public static void main(String[] args) {
System.out.println("123");
}
}
The issue is connected with Java Debugger extension. I had the same problem and it has been logged in issue log: https://github.com/Microsoft/vscode-java-debug/issues/555
Problem is only with single file applications like HelloWorld. It is ok if you run maven project.
Medsonk's instruction worked for me: https://github.com/Microsoft/vscode-java-debug/issues/555#issuecomment-478464496
summary:
1. make sure uninstall jdk8 clean
2. install jdk11
3. add "vmArgs": "--enable-preview" in launch.json
4. F1, "Java: Clean ……" and "Java: Force ……"
5. run standalone file again
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With