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的位置,保存,重啟即可正常使用


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM