首先参考官方文档的解释
Note: The Java language server requires JDK version 11 or above to launch it self, but this is NOT a requirement to your projects’ runtime. Check Settings for the JDK for more information about how to set the JDK for the extension itself.
即这里需要的JDK11以上的原因是因为Java language Server需要JDK11以上。但是需要注意的是官方文档同样提示
Note: The Java language server requires JDK version 11 or above to launch it self, but this is NOT a requirement to your projects’ runtime. Check Settings for the JDK for more information about how to set the JDK for the extension itself.
也就是这里配置了jdk11以后,并不是说我们的项目运行就必须用JDK11,项目运行的JDK版本可以是任意版本。
假设我的项目使用jdk1.8运行的,那么我需要安装两个版本的JDK,
/Library/Java/JavaVirtualMachines ls