问题在于未找到合适的JDK
解决方法(1、2方法选其一):
- 找到自己的settings.json并添加:
"java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "/usr/local/jdk1.8.0_201"
},
{
"name": "JavaSE-11",
"path": "/usr/local/jdk-11.0.3",
"sources" : "/usr/local/jdk-11.0.3/lib/src.zip",
"javadoc" : "https://docs.oracle.com/en/java/javase/11/docs/api",
"default": true
},
{
"name": "JavaSE-12",
"path": "/usr/local/jdk-12.0.2"
},
{
"name": "JavaSE-13",
"path": "/usr/local/jdk-13"
}
]
- 快捷键Ctrl+Shift+P,输入
Java: Configure Java Runtime
没有安装JDK可以直接通过以下方法直接下载:
- 快捷键(Ctrl+Shift+P)
- 输入
Java: Install New JDK