java: error: release version 5 not supported

While building a new maven java project, sometimes the below error occurs:


Add the following Maven compiler plugin to pom.xml


Also change the Java version on the following places in IntellijIdea:

Open Module Settings(F4) -> Project Settings -> Project -> Project SDK

Open Module Settings(F4) -> Project Settings -> Modules -> Sources -> Language level


File -> Settings (ctrl+alt+s) -> Build, Execution, Deployment -> Compiler -> Java Compiler -> Project bytecode version

Module -> Target bytecode version


Bijan Patel

Founder & Creator of QAScript | 12+ years of IT Experience | Full Stack Automation Engineer | Blogger | Trainer

You may also like...

Leave a Reply

Your email address will not be published.