JRE System Library Problem J2SE-1.5问题

(1)问题:

Description Resource Path Location Type Build path specifies execution environment J2SE-1.5. 

There are no JREs installed in the workspace that are strictly compatible with this environment. 

WinXin Build path JRE System Library Problem


(2)原因:

maven是项目管理工具,默认使用J2SE-1.5的库管理项目(我的是1.5,也可能是其他版本),

maven-compiler-plugin插件,就是为了告诉maven使用什么版本的库来管理项目。

(3)解决办法:

1.在pom文件中加入以下代码

<build>
    <finalName>WinXin</finalName>
    <plugins>  
        <plugin>    
        <groupId>org.apache.maven.plugins</groupId>    
        <artifactId>maven-compiler-plugin</artifactId>    
        <configuration>    
            <source>1.8</source>    
            <target>1.8</target>    
        </configuration>    
        </plugin>  
      </plugins>  
  </build>

2.更新项目

右键项目/maven/update project/勾选 force update of snapshows/releases


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章