cannot resolve symbol controller

剛纔用Intellij正在寫代碼的過程中,電腦突然死機黑屏了,然後強制關機後重啓電腦,發現點開項目哪個文件,哪個文件報錯,報錯原因是類引入找不到,maven重新clean,install,package都不好使,引入類的那條語句,包可以點進去查看,發現引入的類確實存在,但編譯就是顯示類不存在。
解決辦法:
file–invalidate caches/restart
把緩存清理並重啓就可以了。

網上其它不靠譜解決方案:
1,重啓Intellij
2,重啓電腦
3,重新配置jdk
4,重新配置tomcat
5,項目刪了重新從git上下載
這五條都試了,不好使。

intellij清理緩存並重啓的官方解釋:

**Cleaning System Cache**
IntelliJ IDEA caches a great number of files, therefore the system cache may one day become overloaded. In certain situations the caches will never be needed again, for example, if you work with frequent short-term projects. Also, the only way to solve some conflicts is to clean out the cache.


**To clean out the system caches:**
On the main menu, choose File | Invalidate Caches/Restart. The Invalidate Caches message appears informing you that the caches will be invalidated and rebuilt on the next start. Use buttons in the dialog to invalidate caches, restart IntelliJ IDEA or both.

**It is important to note the following:**
The files are not actually deleted until IntelliJ IDEA restarts.
Opening and closing a project does not result in deleting any files.

**WARNING:**
Cleaning out the system caches, keep in mind that:
It results in clearing the local history.
To avoid losing data, check in the changes to your version control system before invalidating caches.
Causes a complete rebuild of all the projects ever run in the current version of IntelliJ IDEA.

IntelliJ IDEA 2016.2 Help

發佈了459 篇原創文章 · 獲贊 262 · 訪問量 153萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章