(EXT) Eclipse Maven compilation error Dynamic Web Module 3.1 requires Java 1.7 or newer solution

Source: Internet
Author: User

Scenario: The following error was encountered when importing a MAVEN project.

1 Problem description and resolution

When Eclipse Maven developed a JEE project, the compile time encountered the following error :
Descriptionresourcepathlocationtype
Dynamic Web Module 3.1 requires Java 1.7 or newer.bdpline 1Maven java EE Configuration problem

Descriptionresourcepathlocationtype
One or more constraints has not been satisfied.bdpline 1Maven Java EE Configuration problem

But Eclipse has clearly set the compilation level to 1.7:

This is because your Maven compilation level is jdk1.6 or below, and you have imported more than jdk1.7 dependency packages: View the. classpath file for the project under Eclipse's Navigator view:

Workaround:

Use Maven-compiler-plugin to change the MAVEN compilation level to jdk1.7 or more:

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

Finally , you can resolve the problem by executing Maven-Update Project.

(EXT) Eclipse Maven compilation error Dynamic Web Module 3.1 requires Java 1.7 or newer solution

Related Article

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.