就是明明沒有動 code,也沒有改設定,但是全部的 import 都沒有正確連結上 code,導致出現很多個 Cannot resolve symbol
可以參考這篇的解決方法
IntelliJ inspection gives “Cannot resolve symbol” but still compiles code
First of all you should try因為 IntelliJ 也會 cache 很多東西,所以用 File | Invalidate Caches 算是讓他重新整理一次,大概就跟 eclipse 的 clean + rebuild 很像吧,不過這是對於環境的 clean,不妨試試。File | Invalidate Caches
and if it doesn't help, delete IDEA system directory. Then re-import the Maven project and see if it helps.
In some weird cases compiled classes may report wrong info and confuse IDEA. Verify that the classes from this jar report correct names usingjavap
.
沒有留言 :
張貼留言