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


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