VS Code报错Language Support for Java(TM)插件显示需要JDK11 写java代码没有提示

鉴于 IDEA 的打开速度(电脑的垃圾),平常刷 LeetCode 都是在 VSCode 上,结果这几天老是打开给我报错
Java 11 or more recent is required to run. Please download and install a recent JDK

由于平常开发一直需要使用 Java8,将环境变量改为 JDK11 是绝对逼死强迫症的。但是如不不修改,在 VSCode 中写 Java 代码就一点提示都没有,最后去查了一下

About the Java 11 requirement The Eclipse Platform has decided to require Java 11 as the minimum requirement for its September 2020 release. See https://www.eclipse.org/lists/eclipse-pmc/msg03821.html.

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

大概意思就是反正他就是不支持 Java8 了。。。

我的解决方式
我电脑上是有 JDK11 的,但是环境变量配置的是 JDK8,所以我没有动环境变量,而是在插件 setting 中配置了一下 JDK11 的位置

打开设置

搜索以下内容,往下滑找到 Java:Home

@ext:redhat.java


打开 setting.json 文件
将 java.home 修改为你电脑 JDK11 的位置,保存,重启即可正常使用