Java compiler level does not match the version of the installed Java project facet

后端 未结 12 1697
不知归路
不知归路 2020-12-07 07:19

I have created a New Dynamic Project under Eclipse Helios Version, where my JRE Version is set to 1.6. I have added Maven capabilities to the Web Application by clicking on

12条回答
  •  被撕碎了的回忆
    2020-12-07 08:12

    Assuming that you are using the m2e plugin in Eclipse, you'll need to specify the source and target versions as 1.6 for maven-compiler-plugin. m2e uses these values to determine the project's Java compiler level. A snippet of the POM is shown below:

    
      
        
          maven-compiler-plugin
            
              1.6
              1.6
            
        
      
    
    

    Alternatively, you can specify the maven.compiler.source and maven.compiler.target properties with values of 1.6, that happen to be the equivalent:

    
        1.6
        1.6
    
    

提交回复
热议问题