- How to fix the Release Version 5 Not Supported error in IntelliJ
- Solution#
- Additional Notes#
- An alternative solution#
- Top Related Articles
- Introduction
- Error
- Fix
- Maven POM.xml
- Examples
- JDK 14
- Sample pom.xml file
- Verify the fix
- Maven Tutorial
- Error java source option 5 is no longer supported use 6 or later intellij idea
- Solution
- Additional Notes
- An alternative solution
- Introduction
- Error
- Fix
- Maven POM.xml
- Examples
- JDK 14
- Sample pom.xml file
- Verify the fix
- Maven Tutorial
How to fix the Release Version 5 Not Supported error in IntelliJ
What do you do when you create a new Maven Java project, and when you run it, you get the following error:
Error:java: error: release version 5 not supported
Sometimes the error could also read as follows:
java: Source option 5 is no longer supported. Use 6 or later.
Luckily for us, the solution is exactly the same!
Solution#
Open the project’s pom.xml file and add the following snippet:
Now open the Maven side-panel, and click the Report All Maven Projects button.
You can now successfully run your new Maven Java project.
Additional Notes#
The release version 5 not supported error is quite common with newly created projects.
The java error is frequently seen in IntelliJ after a new Maven project has begun and full setup has not been completed.
By default, the project bytecode version is not actually set in Java maven projects.
Therefore it believes that your current version is set to 5.
Open up Project Settings > Build , Execution …> compiler > java compiler and change your bytecode version to your current java version.
An alternative solution#
If the above does not work for you when trying to solve the java error: release version 5 not supported in IntelliJ, you can attempt the following alternative:
- Open the IntelliJ preferences dialog.
- Filter the navigation items by typing compiler .
- Move to the Maven->Java Compiler section.
- In the right hand configuration panel, there is a list of modules and their accompanying Java compile versions. This is called the target bytecode version .
- Finally select a version bigger than 1.5.
Note that if there is no version greater than 1.5 available in the above list, then you will need to upgrade your Java Development Kit (JDK) on the local machine.
Once all of these steps have been completed, you may also want to go to the Project Structure contextual menu and select Modules . Under here you will have the option to change each of the module’s language level .
You can also always just update your pom.xml to contain the following:
This will fix your java: error: release version 5 not supported problem encountered while trying to run, or execute a Maven Java application in IntelliJ IDEA.
Top Related Articles
- How to Reverse an Integer in Java
- Reverse a String in-place using Java
- Check if a Java array Contains Duplicates
- The Array Height Checker Problem in Java
- Find the Squares of a Sorted Array in Java
- Sorting a Java Array by Parity
- Remove Duplicates from Sorted Array in Java
- Replace Elements with Greatest Element on Right Side using Java
- The Valid Mountain Array Problem using Java
- Find Numbers with Even Number of Digits using Java
Introduction
When we create Maven projects using artifacts and try to run them, we sometimes get the following error. Source option 5 is no longer supported. Use 7 or later. In this post, let’s see the steps involved to fix the error in the Maven project.
The error (Source option 5 is no longer supported) is common when we create a Maven project from the old archetypes. In this case, we need to specify the source and target version to the Maven compiler. We can specify these properties in Maven pom.xml file.
Error
[ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] Source option 5 is no longer supported. Use 7 or later. [ERROR] Target option 5 is no longer supported. Use 7 or later. [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.025 s ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 3.1:testCompile (default-testCompile) on project AppiumProject: Compilation failure: Compilation failure: [ERROR] Source option 5 is no longer supported. Use 7 or later. [ERROR] Target option 5 is no longer supported. Use 7 or later.
Fix
The fix for the problem is to use the latest Java environment for the project that is above JDK 7 or Later.
Identify the JDK version installed on your machine or the version the IDE workspace uses. Update the project build path with the latest library settings.
Right-click Project properties >> Java Compiler.
Change the JDK compliance parameters from 1.5 -> 1.7 or above.
Click on the Execution Environments link and select the latest or suitable JDK above JDK 1.7
Click on Apply and Close button.
Maven POM.xml
Follow the below steps to avoid this error in the Maven project,
- Check the Java compiler version. (Project-specific settings)
- Workspace settings. (Configure Workspace settings)
- Project build path.
- Maven POM.xml build file.
Examples
For example, to specify JDK 8 we can add the properties like the below to the POM.xml file:
JDK 14
Change the Java compiler and the project build path. After the changes specify the JDK version in the POM.xml Maven build file.
For example, specify the JDK 14 to the Maven pom.xml.
Sample pom.xml file
Sample pom.xml file with JDK 14 version
4.0.0 com.testingdocs TestNGTutorials 0.0.1-SNAPSHOT 14 14 org.seleniumhq.selenium selenium-java 4.0.0-alpha-7 org.seleniumhq.selenium selenium-firefox-driver 4.0.0-alpha-7 org.seleniumhq.selenium selenium-edge-driver 4.0.0-alpha-7 org.testng testng 6.8 org.apache.maven.plugins maven-surefire-plugin 3.0.0-M5
Verify the fix
Run the Maven project. The error should be fixed now.
After changing the settings and adding the properties information to the pom.xml file. Verify by running the project. In Eclipse IDE, to build the project choose the option
Maven Tutorial
Maven tutorial on this website:
For more information on the Maven build tool, visit the official website:
Error java source option 5 is no longer supported use 6 or later intellij idea
What do you do when you create a new Maven Java project, and when you run it, you get the following error:
Error:java: error: release version 5 not supported
Sometimes the error could also read as follows:
java: Source option 5 is no longer supported. Use 6 or later.
Luckily for us, the solution is exactly the same!
Solution
Open the project’s pom.xml file and add the following snippet:
Now open the Maven side-panel, and click the Report All Maven Projects button.
You can now successfully run your new Maven Java project.
Additional Notes
The release version 5 not supported error is quite common with newly created projects.
The java error is frequently seen in IntelliJ after a new Maven project has begun and full setup has not been completed.
By default, the project bytecode version is not actually set in Java maven projects.
Therefore it believes that your current version is set to 5.
Open up Project Settings > Build , Execution …> compiler > java compiler and change your bytecode version to your current java version.
An alternative solution
If the above does not work for you when trying to solve the java error: release version 5 not supported in IntelliJ, you can attempt the following alternative:
- Open the IntelliJ preferences dialog.
- Filter the navigation items by typing compiler .
- Move to the Maven->Java Compiler section.
- In the right hand configuration panel, there is a list of modules and their accompanying Java compile versions. This is called the target bytecode version .
- Finally select a version bigger than 1.5.
Note that if there is no version greater than 1.5 available in the above list, then you will need to upgrade your Java Development Kit (JDK) on the local machine.
Once all of these steps have been completed, you may also want to go to the Project Structure contextual menu and select Modules . Under here you will have the option to change each of the module’s language level .
You can also always just update your pom.xml to contain the following:
This will fix your java: error: release version 5 not supported problem encountered while trying to run, or execute a Maven Java application in IntelliJ IDEA.
Introduction
When we create Maven projects using artifacts and try to run them, we sometimes get the following error. Source option 5 is no longer supported. Use 7 or later. In this post, let’s see the steps involved to fix the error in the Maven project.
The error (Source option 5 is no longer supported) is common when we create a Maven project from the old archetypes. In this case, we need to specify the source and target version to the Maven compiler. We can specify these properties in Maven pom.xml file.
Error
[ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] Source option 5 is no longer supported. Use 7 or later. [ERROR] Target option 5 is no longer supported. Use 7 or later. [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.025 s ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 3.1:testCompile (default-testCompile) on project AppiumProject: Compilation failure: Compilation failure: [ERROR] Source option 5 is no longer supported. Use 7 or later. [ERROR] Target option 5 is no longer supported. Use 7 or later.
Fix
The fix for the problem is to use the latest Java environment for the project that is above JDK 7 or Later.
Identify the JDK version installed on your machine or the version the IDE workspace uses. Update the project build path with the latest library settings.
Right-click Project properties >> Java Compiler.
Change the JDK compliance parameters from 1.5 -> 1.7 or above.
Click on the Execution Environments link and select the latest or suitable JDK above JDK 1.7
Click on Apply and Close button.
Maven POM.xml
Follow the below steps to avoid this error in the Maven project,
- Check the Java compiler version. (Project-specific settings)
- Workspace settings. (Configure Workspace settings)
- Project build path.
- Maven POM.xml build file.
Examples
For example, to specify JDK 8 we can add the properties like the below to the POM.xml file:
JDK 14
Change the Java compiler and the project build path. After the changes specify the JDK version in the POM.xml Maven build file.
For example, specify the JDK 14 to the Maven pom.xml.
Sample pom.xml file
Sample pom.xml file with JDK 14 version
4.0.0 com.testingdocs TestNGTutorials 0.0.1-SNAPSHOT 14 14 org.seleniumhq.selenium selenium-java 4.0.0-alpha-7 org.seleniumhq.selenium selenium-firefox-driver 4.0.0-alpha-7 org.seleniumhq.selenium selenium-edge-driver 4.0.0-alpha-7 org.testng testng 6.8 org.apache.maven.plugins maven-surefire-plugin 3.0.0-M5
Verify the fix
Run the Maven project. The error should be fixed now.
After changing the settings and adding the properties information to the pom.xml file. Verify by running the project. In Eclipse IDE, to build the project choose the option
Maven Tutorial
Maven tutorial on this website:
For more information on the Maven build tool, visit the official website: