以上错误是因为Java版本不匹配
file -> settings -> Build Execution and Deployment -> Java -> Compiler
File -> Project Structure -> Module Settings -> Tab: Source: Language Level
File -> Project Structure -> Project(In left pane) -> Project language level