VS Code error Language Support for Java(TM) 插件显示需要 JDK11 才能在无提示的情况下编写 Java 代码
最编程
2024-05-09 21:35:10
...
鉴于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的位置,保存,重启即可正常使用
原文地址:https://www.cnblogs.com/erkye/p/13468315.html
下一篇: PMC 在制造企业中有何价值?