解决vscode的报错:Java 11 or more recent is required to run the Java extension

解决Java 11 or more recent is required to run the Java extension. Please download and install a recent JDK. 的问题

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, the same requirement applies to vscode-java but on a more agressive timeline: vscode-java usually consumes JDT.LS builds that depend on bleeding edge JDT features, effectively shipping pre-release versions of Eclipse Platform/JDT. As of July 22nd, 2020, Java 11 is now required for running vscode-java.

Do I need to migrate my projects to Java 11?

NO you don’t! Well you should, be we’re not here to judge. It is still possible to compile/run Java applications from Java 1.5 to 14, provided the proper java.configuration.runtimes are configured in the user’s settings.json.

My Gradle version does not support Java 11

You can set the java.import.gradle.java.home preference to specifically run the Gradle Daemon using a prior version of Java. However, this only works for Gradle >= 4.7.

解决方法
  1. 卸载旧版本jdk,安装jdk11版本及以上版本
  2. 安装jdk11版本,进入setting.json配置
"java.configuration.runtimes": [
  {
    "name": "JavaSE-1.8",
    "path": "/path/to/jdk-8",
  },
  {
    "name": "JavaSE-11",
    "path": "/path/to/jdk-11",
  },
  {
    "name": "JavaSE-14",
    "path": "/path/to/jdk-14",
    "default": true
  },
]
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值