Visual Studio Code showing “Java 11 or more recent is required to run. Please download and install a recent JDK”

后端 未结 8 2055
庸人自扰
庸人自扰 2020-12-05 17:28

Today Visual Studio Code started showing me a pop-up saying:

Java 11 or more recent is required to run. Please download and install a recent JDK.

相关标签:
8条回答
  • 2020-12-05 17:51

    About the Java 11 requirement:

    The Eclipse platform has decided to require Java 11 as the minimum requirement for its September 2020 release. See Upgrading the Eclipse SDK target environment for the September Eclipse release....

    Because vscode-java depends on the Eclipse JDT.LS server, that same requirement to vscode-java. But the timeline is be more aggressive: Indeed, vscode-java usually consumes JDT.LS builds that depend on bleeding edge JDT features, so effectively shipping pre-release versions of Eclipse Platform/JDT. As of July 22nd, 2020, Java 11 is now required for running vscode-java.

    This is from:https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements#java.configuration.runtimes

    0 讨论(0)
  • 2020-12-05 17:52
    1. Just uninstall all previous JDKs, i.e., less than or equal to JDK 11.

    2. Re-install JDK 11 from https://www.oracle.com/java/technologies/javase-jdk11-downloads.html

    3. Make sure your system variable JAVA_HOME points to the latest installed JDK like "C:\Program Files\Java\jdk-11.0.8" (for Windows)

    4. Restart Visual Studio Code

    5. Go to Workspace settingsJava: Home

    6. Select "Edit in settings.json"

    7. Your settings.json should look like:

      settings.json_image

      {
          "java.completion.favoriteStaticMembers": [
      
              "org.junit.Assert.*",
              "org.junit.Assume.*",
              "org.junit.jupiter.api.Assertions.*",
              "org.junit.jupiter.api.Assumptions.*",
              "org.junit.jupiter.api.DynamicContainer.*",
              "org.junit.jupiter.api.DynamicTest.*",
              "org.mockito.Mockito.*",
              "org.mockito.ArgumentMatchers.*",
              "org.mockito.Answers.*"
          ],
          "java.home": "C://Program Files//Java//jdk-11.0.8"
      }
      
    0 讨论(0)
提交回复
热议问题