標籤:style blog http color io 使用 ar java strong
最近在項目中老是遇到Eclipse 的環境問題今天統一解決記錄下來。
問題1:
Resource is out of sync with the file system......
eclipse中檔案不同步引起的。在eclipse中,工程檔案是由eclipse自動掃描添加的,如果在外部修改了工程目錄中的檔案但又關閉了自動重新整理功能,則會引起檔案不同步,從而搜尋時出現Resource is out of sync with the file
system問題(其它功能可能也會如此)。此外,在外部沒有修改eclipse工程中的檔案也有可能引起該問題。
解決方案:
有兩種解決方案:
1)手動重新整理。即在eclipse的工程目錄中,右鍵refresh(或者按下F5)。
2)配置eclipse的選項:
a)eclipse啟動時,重新整理workspace,即勾選:window—>preferences—>general—>startup and shutdown—>refresh workspace on startup;
b)window—>preferences—>general—>workspace中:勾選選項:refresh using native hooks or polling和refresh on access;
問題2 。m2eclipse報錯"Unable to locate the Javac Compiler in:
maven package時總報錯:
"Unable to locate the Javac Compiler in: D:\Program Files\Java\jdk1.7.0_60\..\lib\tools.jar"
方法一:
- Window
-> Preferences -> Java -> Installed
JREs(如果列表中包含有效JRE忽略此步驟)。點擊"Add"按鈕,選擇預設的"Standard VM", 點擊"Next >",
點擊"JRE home"右邊的"Directory"選擇檔案夾D:\Program
Files\Java\jdk1.6.0_20\jre,一路“確定”。
- 回到"Installed JREs"介面,在剛添加的"jdk1.6.0_20"打上勾。
- 開啟
"Installed JREs" -> "Execution Environments", 點選介面左側的"J2SE-1.5",然後在右側點選"jdk1.6.0_20"
- 重啟Eclipse
方法二:
Windows->preferences->java->installed jREs ->中加上tools.jar
方法三:
- Windows->preferences->java->installed jREs,使用“Serach”尋找JRE
- 開啟 "Installed JREs" -> "Execution Environments", 點選介面左側的"J2SE-1.5",然後在右側點選你Search出來的JRE
參考URL:
http://alvinqq.iteye.com/blog/947506
http://blog.csdn.net/pengchua/article/details/2604911
Eclipse 的環境問題1