星期一, 10月 08, 2012

Eclipse “cannot be resolved to a type” error

不知什麼問題,明明上一次才compile過,也沒動到任何東西
發現在project name(右鍵)/properties裡的Java Build Path

改了JRE的環境,本身是裝jdk1.7 但這裡是寫1.5(如左圖)
就改了一下... 然後就... 好了...






後記...
跟java版本無關,而是重新compile的問題
maven不會對未更動的檔案重新compile,因此有更動的檔案(該檔案需重新compile)後
就會出現cannot be resolved to a type

解決方法:
就重新設定JRE環境,就會自動重新build一次
不曉得這是ecilpse問題還是maven問題

Reference
Eclipse “cannot be resolved to a type” error

沒有留言: