javaweb项目编译错误

Posted on 2017-04-12 16:05  小小蜗牛灬  阅读(408)  评论(0编辑  收藏  举报

Eclipse Maven 开发一个 jee 项目时,编译时遇到以下错误
Description Resource Path Location Type
Dynamic Web Module 3.0 requires Java 1.6 or newer. bdp line 1 Maven Java EE Configuration Problem

Description Resource Path Location Type
One or more constraints have not been satisfied. bdp line 1 Maven Java EE Configuration Problem

 

解决方案:

  使用 maven-compiler-plugin 将 maven 编译级别改为 jdk1.6 以上:

  

<build>  
    <plugins>  
        <!-- define the project compile level -->  
        <plugin>  
            <groupId>org.apache.maven.plugins</groupId>  
            <artifactId>maven-compiler-plugin</artifactId>  
            <version>2.3.2</version>  
            <configuration>  
                <source>1.7</source>  
                <target>1.7</target>  
            </configuration>  
        </plugin>  
    </plugins>  
</build>  

 

Copyright © 2024 小小蜗牛灬
Powered by .NET 8.0 on Kubernetes