1. 程式人生 > >eclipse專案中出現紅叉

eclipse專案中出現紅叉

eclipse中選擇->window->show view->other彈出對話方塊中選擇general下面找problems然後雙擊

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,可以在視窗右邊看到編譯器版本,如圖所示: