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 ?
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.
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.
- First of all Click on File in Intellij IDEA.
- Then Select Project Structure.
- Click on Modules.
- Then Select Language level to 8 ( my maven project was set to 1.8 java).
- Click on File in Intellij IDEA.
- Select Setting.
- Now, Select Build, Execution, Deployment.
- Tap on Compiler.
- Select Java Compiler.
- Select 8 and 8 will be also there
- Now your error should be solved.
Solution 2: Follow this step.
- 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.
Solution 3: Use this solution.
- Change the version of Java from 11 to 8 in pom.xml file
<java.version>1.8</java.version> - 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.
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