Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. 

新建maven2工程时,会自动将jre library指向为j2se-1.5,而不是我安装的jdk1.6, 

在java build path 中奖j2se-1.5移除掉又选择jdk1.6后,右键项目maven -》update 

project..又把我的jdk改成了1.5. 

后来更改maven 的pom文件才解决这一问题: 

Java代码  在Eclipse中创建maven项目出现的环境警告 j2se-1.5
    1.    <build>  
    2.     <finalName>MavenProject</finalName>  
    3.       <plugins>  
    4.         <plugin>    
    5.         <groupId>org.apache.maven.plugins</groupId>    
    6.         <artifactId>maven-compiler-plugin</artifactId>    
    7.         <configuration>    
    8.             <source>1.6</source>    
    9.             <target>1.6</target>    
    10.         </configuration>    
    11.         </plugin>  
    12.       </plugins>  
    13. </build>  

相关文章:

  • 2021-10-22
  • 2021-08-21
  • 2021-04-06
  • 2021-08-13
  • 2021-04-10
  • 2021-05-25
  • 2022-01-05
猜你喜欢
  • 2021-09-11
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2021-05-16
  • 2022-01-03
  • 2021-04-17
相关资源
相似解决方案