(Fixed) An error occurs when using Java 8 with the latest version (0.65.0) of Language Support for Java (TM) by Red Hat of VS Code.

(Addition at the beginning) It was a specification when I thought it was a bug.

Since Java 11 or higher is required in Language Support for Java (TM) version (0.65.0) or later, an error will be thrown in the Java 8 environment. At first I thought it was a bug, but it seems to be a specification. (Thank you for letting me know in the comments!)

Even the Java tutorial of VS Code does not work unless it is Java 11 or higher. https://code.visualstudio.com/docs/languages/java

スクリーンショット 2020-07-29 22.25.38.png

Please refer to the following URL for the solution. https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements#setting-the-jdk

In particular,

"java.home": "c:\\java\\jdk-11",
"java.configuration.runtimes": [
    {
        "name": "JDK-1.8",
        "path": "C:\\java\\Java1.8.0_151",
        "default": true
    },
],

I think that you should set jdk-11 in Java_Home like this and set jdk-8 to default in runtimes.

(Original article) A bug occurs in the latest version (0.65.0) of Language Support for Java (TM) by Red Hat of VS Code (July 23, 2020)

I'm writing Java using VSCode, but I'm creating a project template. Java: Create Java Project no longer works and I get the following error:

スクリーンショット 2020-07-23 9.57.13.png

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



 After this came out, I couldn't execute it normally. I was in trouble.
 The environment uses open-JDK8 with Remote-Container, and it worked in a good mood until yesterday. There is no problem with the JAVA_HOME setting.

 I wandered around for about 4 hours, but the cause was Language Support for Java (TM) by Red Hat ver0.65.0, which was updated the day before.
 I finally found a post from someone who had the same symptoms and was able to respond. Thanks.

[URGENT- "Java 11 or more recent is required to run. Please download and install a recent JDK" #852
](https://github.com/microsoft/vscode-java-debug/issues/852)


 For the time being, we are waiting for support by downgrading the extension. I'll keep it in case someone in the same situation.
 <img width="610" alt="スクリーンショット 2020-07-23 16.20.45.png " src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/270149/6e7204f6-2b2c-e540-40e8-e2545075ceed.png ">



Recommended Posts

(Fixed) An error occurs when using Java 8 with the latest version (0.65.0) of Language Support for Java (TM) by Red Hat of VS Code.
The procedure I did when I prepared the environment of gradle + Java with VS Code (Windows 10)
Switch the version of java installed by SDKMAN when moving directories
Is the version of Elasticsearch you are using compatible with Java 11?
[Error] Error during Docker build (solved by pulling the latest version of image)
[Error resolution] Occurs when trying to build an environment for spring with docker
Send an email when an ERROR level log occurs with the logback SMTP Appender
When using a list in Java, java.awt.List comes out and an error occurs
Let's create a TODO application in Java 12 Processing when a request comes in with an unused HttpMethod ・ Processing when an error occurs in the server
Using Gradle with VS Code, build Java → run
The story when the container does not start up with docker-compose up and an error occurs