Preferences->Java->Installed JREs->选中使用的jre->Edit...-> Add External JARs-> 添加本地jdk的 lib文件下的 tools.jar 重新 maven 编译即可