建立maven項目出現錯誤Could not find artifact com.sun:tools:jar:1.5.0 解決方法:java
錯誤以下:eclipse
Java代碼 maven
- find artifact com.sun:tools:jar:1.5.0 at specified path
- E:/Java/jre6/../lib/tools.jar -> [Help 1][ERROR]
- [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
- [ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR]
- [ERROR] For more information about the errors and possible solutions,
- please read the following articles:[ERROR] [Help 1]
解決辦法:spa
Window -> Preferences -> Java -> Installed JREs, 點擊"Add"按鈕,選擇默認的"Standard VM", 點擊"Next >", 點擊"JRE home"右邊的"Directory"選擇文件夾E:\Java\jdk1.6.0_38,一路「肯定」,回到"Installed JREs"界面,在剛添加的"jdk1.6.0_38"打上勾。debug
再選擇目錄樹中的"Execution Environments", 點選界面左側的"J2SE-1.5",而後在右側點選"jdk1.6.0_38"。以下圖orm
重啓Eclipse,一切OK了。blog
另外,在eclipse.ini文件中加了兩行(必定要加在-vmargs以前,並且-vm後面有回車):ip
-vm
E:/Java/jdk1.6.0_38/bin/javaw.execi