1. 程式人生 > >解決java compiler level does not match the version of the installed java project facet

解決java compiler level does not match the version of the installed java project facet

ref 目錄 ngs eclipse 項目 cor 點擊 遇到 log

因為遇到這個問題,所以記錄一下。

轉載自:https://blog.csdn.net/chszs/article/details/8125828


java compiler level does not match the version of the installed java project facet錯誤的解決

因工作的關系,Eclipse開發的Java項目拷來拷去,有時候會報一個很奇怪的錯誤。明明源碼一模一樣,為什麽項目復制到另一臺機器上,就會報“java compiler level does not match the version of the installed java project facet”錯誤呢?

如圖所示:

技術分享圖片

其實要解決也很簡單,在資源管理器下,找到項目所在的目錄,在.settings子目錄裏面,用文本編輯器打開org.eclipse.wst.common.project.facet.core.xml配置文件,如圖所示:

技術分享圖片

修改紅色畫線部分,讓它與項目的編譯器版本設置保持一致即可。

要查看項目的編譯器版本設置,在Eclipse環境中,鼠標右鍵選擇項目,點擊Properties,選擇Java Compiler,可以在窗口右邊看到編譯器版本,如圖所示:

技術分享圖片

解決java compiler level does not match the version of the installed java project facet