Following on redhat-developer/vscode-java#671, when trying to run Java 12 code using preview features, you need to add the --enable-preview flag in the launch configuration's vmArgs:
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - Demo",
"request": "launch",
"mainClass": "foo.bar.Demo",
"projectName": "Demo",
"vmArgs": "--enable-preview"
}
]
}
This could be done automatically by the vscode-java-debug extension
Following on redhat-developer/vscode-java#671, when trying to run Java 12 code using preview features, you need to add the
--enable-previewflag in the launch configuration'svmArgs:{ "configurations": [ { "type": "java", "name": "CodeLens (Launch) - Demo", "request": "launch", "mainClass": "foo.bar.Demo", "projectName": "Demo", "vmArgs": "--enable-preview" } ] }This could be done automatically by the vscode-java-debug extension