右键项目 Properties
选择 Project Facets
勾选java
来自:https://blog.csdn.net/bighotback/article/details/77191157