转自:http://www.cnblogs.com/beppezhang/p/5919221.html

 

当创建动态的web 3.0的项目时需要java1.6及以上的版本支持;

而我们的eclipse中创建的maven骨架默认是java1.5的版本,这种情况下就会报以下的错误:Dynamic Web Module 3.0 requires Java 1.6 or newer.

原因:

动态的web3.0,项目需要java1.6的版本,而maven默认创建的是java1.5的版本,所以会报这个错误;

解决方案:

1:在eclipse上安装jre:选中jdk的目录即可,需要1.6以上的版本;指定编译版本,1.6以上的版本;

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
    

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.

2:指定项目的facet的java版本不能低于1.6版本;

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
    

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.

3:在maven 的pom.xml中指定maven项目的jdk运行版本

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
    

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
<!-- 指定maven项目的编译时使用的jdk版本 -->
        <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>
maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
    

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.

4:最后在选中该项目,单击maven——>updateproject即可;

当创建动态的web 3.0的项目时需要java1.6及以上的版本支持;

而我们的eclipse中创建的maven骨架默认是java1.5的版本,这种情况下就会报以下的错误:Dynamic Web Module 3.0 requires Java 1.6 or newer.

原因:

动态的web3.0,项目需要java1.6的版本,而maven默认创建的是java1.5的版本,所以会报这个错误;

解决方案:

1:在eclipse上安装jre:选中jdk的目录即可,需要1.6以上的版本;指定编译版本,1.6以上的版本;

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
    

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.

2:指定项目的facet的java版本不能低于1.6版本;

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
    

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.

3:在maven 的pom.xml中指定maven项目的jdk运行版本

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
    

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
<!-- 指定maven项目的编译时使用的jdk版本 -->
        <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>
maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.
    

maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.

4:最后在选中该项目,单击maven——>updateproject即可;

相关文章:

  • 2021-11-20
  • 2021-07-07
  • 2021-07-06
  • 2022-02-05
  • 2022-12-23
  • 2021-05-30
  • 2021-07-10
猜你喜欢
  • 2022-01-20
  • 2022-12-23
  • 2021-09-22
  • 2021-12-23
  • 2021-10-29
相关资源
相似解决方案