We Are Going To Discuss About IntelliJ: Error:java: error: release version 5 not supported. So lets Start this Java Article.
IntelliJ: Error:java: error: release version 5 not supported
- IntelliJ: Error:java: error: release version 5 not supported
Took me a while to aggregate an actual solution, but here's how to get rid of this compile error.
Open IntelliJ preferences.
Search for “compiler” (or something like “compi”).
Scroll down to Maven –>java compiler. In the right panel will be a list of
modules and their associated java compile version “target bytecode version.”
Select a version >1.5. You may need to upgrade your jdk if one is not available. - Error:java: error: release version 5 not supported
Took me a while to aggregate an actual solution, but here's how to get rid of this compile error.
Open IntelliJ preferences.
Search for “compiler” (or something like “compi”).
Scroll down to Maven –>java compiler. In the right panel will be a list of
modules and their associated java compile version “target bytecode version.”
Select a version >1.5. You may need to upgrade your jdk if one is not available.
Solution 1
See https://stackoverflow.com/a/12900859/104891.
First of all, set the language level
/release versions
in pom.xml
like that:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Maven sets the default to 1.5 otherwise. You will also need to include the maven-compiler-plugin
if you haven’t already:
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</dependency>
Also, try to change the Java version in each of these places:
File -> Project structure -> Project -> Project SDK -> 11.
File -> Project structure -> Project -> Project language level -> 11.
File -> Project structure -> Project -> Modules -> -> Sources –> 11
In project -> ctrl + alt + s -> Build, Execution, Deployment -> Compiler -> Java Compiler -> Project bytecode version -> 11
In project -> ctrl + alt + s -> Build, Execution, Deployment -> Compiler -> Java Compiler -> Module -> 1.11.
Original Author Of This Content
Solution 2
Took me a while to aggregate an actual solution, but here’s how to get rid of this compile error.
-
Open IntelliJ preferences.
-
Search for “compiler” (or something like “compi”).
-
Scroll down to Maven –>java compiler. In the right panel will be a list of
modules and their associated java compile version “target bytecode version.” -
Select a version >1.5. You may need to upgrade your jdk if one is not available.
Original Author Of This Content
Solution 3
By default, your “Project bytecode version isn’t set in maven project.
It thinks that your current version is 5.
Solution 1:
Just go to “Project Settings>Build, Execution…>compiler>java compiler” and then change your bytecode version to your current java version.
Solution 2:
Adding below build plugin in POM file:
<properties>
<java.version>1.8</java.version>
<maven.compiler.version>3.8.1</maven.compiler.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
Original Author Of This Content
Solution 4
I add the following code to my pom.xml
file. It solved my problem.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Original Author Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.