[Maven] "Dynamic Web Module 3.0 requires Java 1.6 or newer." or "Jax-rs (REST Web Services) 2.0 requires Java 1.6 or newer."

Source: Internet
Author: User

Open source projects downloaded on the Web, built with Maven, with an error:

Dynamic Web Module 3.0 requires Java 1.6 or newer.

Jax-rs (REST Web Services) 2.0 requires Java 1.6 or newer.

Even if you set the Properties->java Compiler->complier compliance level to 1.7 or 1.8, it doesn't work.

Workaround:

The first step is to define the version of the JDK in Pom.xml, as follows

    <build>        <finalName>Example</finalName>        <plugins>            <plugin>                < Groupid>org.apache.maven.plugins</groupid>                <artifactid>maven-complier-plugin</artifactid >                <version>3.0</version>                <configuration>                    <source>1.7</source>                    <target>1.7</target>                    <encoding>UTF-8</encoding>                </configuration>            </plugin>        </plugins>  </build>

And

<properties>            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>        < Maven.compiler.encoding>utf-8</maven.compiler.encoding>    <maven.compiler.source>1.7</ maven.compiler.source>    <maven.compiler.target>1.7</maven.compiler.target>    < Maven.compiler.compilerversion>1.7</maven.compiler.compilerversion>    </properties>

  

In the second step, modify the Org.eclipse.jdt.core.prefs file in the. Settings folder to change the version to 1.7

org.eclipse.jdt.core.compiler.codegen.targetplatform=1.7org.eclipse.jdt.core.compiler.compliance =1.7Org.eclipse.jdt.core.compiler.source=1.7

In the third step, modify the Org.eclipse.wst.common.project.facet.core.xml in the. Settings folder to change the Java version to 1.7

<installed facet= "java" version= "1.7"/>

When you are done, refresh the project with MAVEN's update project operation.

[Maven] "Dynamic Web Module 3.0 requires Java 1.6 or newer." or "Jax-rs (REST Web Services) 2.0 requires Java 1.6 or newer."

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.