Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)
edited by

Can anyone tell me why I  get “IntelliJ (JAVA): release version 5 not supported” error?

2 Answers

0 votes
by (19.7k points)

Whenever you create a new maven project using IntelliJ IDEA, if you get the following error 

“Error: java: error: release version 5 not supported”

The reason is  Maven sets the default Java version to 1.5. Hence you need to set the language level and release version in pom.xml file correctly. 

Do the following:

File => Settings => Build, Execution, Deployment => Compiler => Java Compiler and change it if required.

If it does not work even after changing the JAVA version, go for the following solutions: 

1. 1.      Set the source /target versions in pom.xml like below:

 

<properties>

     <maven.compiler.source>1.11</maven.compiler.source>

     <maven.compiler.target>1.11</maven.compiler.target>

</properties>

 

To include the maven-compiler-plugin if you have not already like:

 

plugins>

     <plugin>

             <groupId>org.apache.maven.plugins</groupId>

                  <artifactId>maven-compiler-plugin</artifactId>

                  <version>3.6.0</version>

                  <configuration>

                    <source>1.11</source>

                <target>1.11</target>

                  </configuration>

            </plugin>

</plugins

 

If The above-mentioned solution did not work for you, you can move one step further by changing the “language level” in every module at, File => Project Structure => Modules

If you want to learn more about Javathen go through this Java tutorial by Intellipaat for more insights. 

0 votes
by (1.8k points)

The error message that you are getting is just because of the java project in intellij is by default set to use  java 5 which is no longer supported

Update the Compiler setting:

Go to file < settings.

Go to build,execution,deployment < compiler < Java Compiler.

         We have to update the java version in project settings:

         Go to file < project structure < project.

         In project dropdown select jdk version that you have installed

         In the project level dropdown select the jdk version which is more    suitable with your project requirements

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...