MAVEN compiles Java project issues (primarily for idea)--error:java: Invalid target release: 1.8

Source: Internet
Author: User

First of all, the main reason for this problem is that the Javac version of the compilation conflicts with the version of the actual project compilation, so the problem is solved from these aspects:

1. View the project JDK version and language level, File-->project structrue-->project

2. View the level of compilation, File-->settings-->build,execution,deployment-->compiler-->java Compiler Modify the level of compilation

3. For MAVEN projects you can configure the compiled version within the Pom file

(1) Configure in the Properties tab

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><Maven.compiler.source>1.8</Maven.compiler.source><Maven.compiler.target>1.8</Maven.compiler.target>

(2) Configure the compiler plugin within the Build-->plugins tab, as well as configure the compiled version (detailed configuration reference for the plugin http://maven.apache.org/plugins/ maven-compiler-plugin/compile-mojo.html)

<plugin>        <groupId>Org.apache.maven.plugins</groupId>        <Artifactid>Maven-compiler-plugin</Artifactid>        <version>3.7.0</version>        <Configuration>          <Source>1.8</Source>          <Target>1.8</Target>        </Configuration></plugin>

Maven compiles Java project issues (primarily for idea)--error:java: Invalid target release: 1.8

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.