在eclipse中使用搜索功能,發生錯誤:
"File Search" has encounter a problem
仔細看了一下自動跳出的錯誤日誌(Error Log),發現:
.......Resource is out of sync with the file system
或者提示“file not found”之類的信息
原因:eclipse中的文件和workspace中文件不一致。(自己在workspace中用改了某個文件,即在eclipse工程之外的地方修改了源文件但是沒有刷新)
解決方法:
方法1 在工程目錄右鍵 Refresh
方法2 設置eclipse自動刷新(Window->Preferences->General->Workspace,選中Refresh automatically)
注:推薦使用方法1,方法2設置爲自動刷新在工程比較大時代價有點大。