Below changes worked for me and hope the same works for you.
Change the version of Java from 11 to 8 in pom.xml file
<java.version>1.8</java.version>
Go to, File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler
Here, in Module column you can see your project listed and in Target bytecode version column, Java version for the project is already specified(mostly 11), change it to 8
Go to, File -> Project Structure -> Modules. Here, in Source tab, you can see Language level option, choose 8 - Lambdas, type annotations etc.. Finally, choose Apply and OK, you're good to go.