需要运行显示"Java 11或更高版本"的Visual Studio代码.请下载并安装最新的JDK". [英] Visual Studio Code showing "Java 11 or more recent is required to run. Please download and install a recent JDK"
问题描述
今天,Visual Studio Code开始向我显示一个弹出窗口:
Today Visual Studio Code started showing me a pop-up saying:
需要运行Java 11或更高版本.请下载并安装最新的JDK.
Java 11 or more recent is required to run. Please download and install a recent JDK.
我需要使用JDK 8 (在Apache Beam上运行,这是最后一个受支持的版本).我一直在努力,直到出现这个问题为止.
I need to use the JDK 8 (working on Apache Beam and that's the last supported version). I have been working on that and haven't had any issues until this came up.
我已阅读这篇文章并执行此处提到的要点.
I have read through this article and implemented the points mentioned there.
这是我在Visual Studio Code上的工作区设置(我已经仔细检查了路径)
Here is my workspace settings on Visual Studio Code (I have double-checked the paths)
{
"java.configuration.updateBuildConfiguration": "disabled",
"java.home": "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home",
"java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home",
"default": true
},
{
"name": "JavaSE-11",
"path": "/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home",
}
]
}
其他有用信息:
➜ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
和
➜ which java
/usr/bin/java
即使我已经在Visual Studio Code上成功运行JDK 8一段时间了,今天还是开始发生这种情况.我不记得要更新Visual Studio Code,所以我不确定现在为什么要显示它,因为显然是从4月中旬开始显示弹出窗口(如 vscode-java Gitter频道).
This started happening today even though I have been running JDK 8 on Visual Studio Code successfully for a while now. I don't remember updating Visual Studio Code, so I'm not sure as to why this is being displayed now since apparently the pop-up has been displayed since mid-April (asked on the vscode-java Gitter channel).
推荐答案
更改自
"java.home":"/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home"
到
"java.home":"/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home"
,其余设置保持不变.
这篇关于需要运行显示"Java 11或更高版本"的Visual Studio代码.请下载并安装最新的JDK".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!