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