I recently installed Visual Studio Code and tried to run a simple program
import java.util.*;
public class HelloWorld {
public static void main(String[] args) {
System.out.print("Hello World");
}
}
but I got this
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at HelloWorld.main(nush.java:3)
I'm using java development kit 11.0.1 and this is my launch.json
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - HelloWorld",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "HelloWorld",
"args": ""
}
]
}
class HelloWorldinHelloWorld.javafile.