Why can’t you grab tickets when you travel on holiday?Reveal the key technology of 12306 how to ensure the ticket is not oversold>>>
When running the project with idea, the following error message is encountered:
Error:java: javacTask: source release 8 requires target release 1.8
This is mainly due to the fact that the code written in idea based on JDK 1.8 does not find the corresponding JDK compiler. The solution is as follows:
1. Open file > Settings > Build, Execution, Deployment > Java Compiler
2. Change the bytecode version of the compiled code to 1.8, as shown in the figure below:
3. If Maven is used in the project, you can also change the setting of pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
Choose one of the above two methods (1, 2 and 3). Note that after changing the pom.xml file, you need to select the reimport option in the Maven menu of idea to re import the project settings. Idea will automatically select the correct settings
Reference link: https://stackoverflow.com/questions/29888592/errorjava-javactask-source-release-8-requires-target-release-1-8
Similar Posts:
- [Solved] Error:java: error: release version 5 not supported & Switch Unrecognized String
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- [Solved] Error:java: Compilation failed: internal java compiler error
- [Solved] Dynamic Web Module 3.0 requires Java 1.6 or newer
- Automatic version change of IntelliJ idea language level and Java compiler
- Dynamic Web Module 3.1 requires Java 1.7 or newer
- [Solved] Error: Package com.sun.xml.internal.bind.v2.model.core does not exist
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- How to Solve IDEA maven Error:Perhaps you are running on a JRE rather than a JDK
- Maven [error] no longer supports source option 5. Please use version 7 or later