在vscode编译项目,碰到“Build path specifies execution environment There are no JREs installed 。。。。。。”等字样,表示项目默认的jdk版本和vscode设置的版本不一致,解决方法如下:
在pom.xml加入maven compiler, 例如加入jdk11:
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
保存重新build项目即可。