close

[Solved] Error:java: invalid target release: 11

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to build my application in IntelliJ But I am facing following error Error:java: invalid target release: 11 in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How this Error Occurs ?

I am trying to build my application in IntelliJ But I am facing following error.

Information:java: Errors occurred while compiling module ‘test-domain_main’
Information: javac 1.8.0_171 was used to compile java sources
Information:1/10/2019 4:21 PM – Compilation completed with 1 error and 0 warnings in 1s 199ms Error:java: invalid target release: 11

How To Solve Error:java: invalid target release: 11 Error ?

  1. How To Solve Error:java: invalid target release: 11 Error ?

    To Solve Error:java: invalid target release: 11 Error To resolve this issue I've changed File->Project Structure->Modules ->> Language level to 10. And check File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler ->> Project bytecode and Per-module bytecode versions. I have 11 there. Second solution Change the version of Java from 11 to 8 in pom.xml file 1.8 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.

  2. Error:java: invalid target release: 11

    To Solve Error:java: invalid target release: 11 Error To resolve this issue I've changed File->Project Structure->Modules ->> Language level to 10. And check File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler ->> Project bytecode and Per-module bytecode versions. I have 11 there. Second solution Change the version of Java from 11 to 8 in pom.xml file 1.8 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.

Solution 1: Setting in your Intellij IDEA

Just make this two setting And Your error will be solved.

  1. First of all Click on File in Intellij IDEA.
  2. Then Select Project Structure.
  3. Click on Modules.
  4. Then Select Language level to 8 ( my maven project was set to 1.8 java).
  1. Click on File in Intellij IDEA.
  2. Select Setting.
  3. Now, Select Build, Execution, Deployment.
  4. Tap on Compiler.
  5. Select Java Compiler.
  6. Select 8 and 8 will be also there
  7. Now your error should be solved.

Solution 2: Follow this step.

  1. To resolve this issue I’ve changed File->Project Structure->Modules ->> Language level to 10.
  2. And check File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler ->> Project bytecode and Per-module bytecode versions. I have 11 there.

Solution 3: Use this solution.

  1. Change the version of Java from 11 to 8 in pom.xml file
    <java.version>1.8</java.version>
  2. 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
  3. 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.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment