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

后端 未结 8 2074
庸人自扰
庸人自扰 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:35

    One workaround is to downgrade the extension "Language Support for Java(TM) by Red Hat" from the most recent version 0.65.0. back to

    vscode-java version 0.64.1.

    (This is not recommended unless you have restrictions on the JDK version, it is just possible, see the remarks at the bottom).

    Taken from Java 11 or more recent is required to run. Please download and install a recent JDK" #1543, this is how to install the earlier extension version (thanks go to the GitHub user who posted this):

    Please mind:

    This should be relevant only for those who cannot install JDK 11 or higher:

    • Due to a 32-bit system (and who by the same time are forced to use an Oracle JDK 8 as their last Oracle version for 32 bit, so that they are not allowed to use the recommended OpenJDK 14 - see JDK Requirements → click at the top at the Java Development Kit link → jump to https://adoptopenjdk.net/)
    • Due to restrictions on a 64-bit system. One "not that plausible" restriction could be some efficient laziness. You might simply not want to install a new JDK and change the Visual Studio Code settings back to your old JDK only because of a version change of the Java extension :).

    You should not do this if you have no important restrictions. The most plausible restriction is that you use Windows 32 bit, which should be relevant only for those who have an old netbook lying around.

    In the usual case: upgrade, and then you can still go back to using an older Java version by changing the settings according to JDK Requirements:

    Do I need to migrate my projects to Java 11?

    "NO, you don't! Well, you should, be we're not here to judge. It is still possible to compile/run Java applications from Java 1.5 to 14, provided the proper java.configuration.runtimes are configured in the user's settings.json."

    --> This means you can upgrade the extension, install at least Java 11 (JDK 11), and use the Java runtime of your choice <= your installed Java version.

    See detailed instructions for Windows 64bit at "Java 11 or more recent is required to run. Please download and install a recent JDK" #1543.

提交回复
热议问题