当我尝试使用 vscode 调试 java 程序时收到此错误:
java.lang.UnsupportedClassVersionError:
test (class file version 52.65535) was compiled with preview features that are unsupported.
This version of the Java Runtime only recognizes preview features for class file version 55.65535
Run Code Online (Sandbox Code Playgroud)
这是launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch) - Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "Debug (Launch)-test",
"request": "launch",
"mainClass": "test"
}
]
}
Run Code Online (Sandbox Code Playgroud)
这是java的版本:
java --version:
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Ubuntu-3ubuntu118.04.2)
OpenJDK 64-Bit …Run Code Online (Sandbox Code Playgroud)