打开Eclipse,右键项目:
properties->Java build path ->Maven->Add library->JRE System Library->Install JREs... ->Add->Standard VM ->Directory...
选择jdk安装路径,例如:
/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
然后Finish,回到Edit Library界面添加刚添加的jdk即可。