Skip to content
Advertisement

Invalid runtime for JavaSE-11: The path points to a missing or inaccessible folder

My VSCode is no longer recognizing the paths of the java runtime. I was using them normally and now it doesn’t work on the same projects anymore. Here are the error messages and my settings. The paths to the runtimes are correct.

Environment:

  • Operating System: Linux Mint 20 Cinnamon
  • JDK version: Openjdk version “11.0.8” 2020-07-14
  • Visual Studio Code version: v1.49.2
  • Java extension version: v0.68.0

Error:

Java Error Message

  • settings.json:
    "java.home": "/usr/lib/jvm/java-11-openjdk-amd64",
    "java.configuration.runtimes": [
    
      {
        "name": "JavaSE-1.8",
        "path": "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java",
      },
      {
        "name": "JavaSE-11",
        "path": "/usr/lib/jvm/java-11-openjdk-amd64/bin/java",
        "default": true
      },
      {
        "name": "JavaSE-14",
        "path": "/usr/lib/jvm/java-14-openjdk-amd64/bin/java",
      },
    ],

Advertisement

Answer

The “path” parameter should be set to the location of the Java runtime directory, not to the java executable file. Take “/bin/java” off the end.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement