I recieved this error when I trying to debug a java program with vscode:
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
Here is 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"
}
]
}
Here is the version of 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 Server VM (build 11.0.2+9-Ubuntu-3ubuntu118.04.2, mixed mode, sharing)
javac --version:
javac 11.0.2
This program can run on ubuntu original terminal, but throws error in vscode.
it would be greatful if you can help me out.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…