创建maven项目出现错误Could not find artifact com.sun:tools:jar:1.5.0 解决方法:
错误如下:
Java代码
- 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]
解决办法:
Window -> Preferences -> Java -> Installed JREs, 点击"Add"按钮,选择默认的"Standard VM", 点击"Next >", 点击"JRE home"右边的"Directory"选择文件夹E:\Java\jdk1.6.0_38,一路“确定”,回到"Installed JREs"界面,在刚添加的"jdk1.6.0_38"打上勾。
再选择目录树中的"Execution Environments", 点选界面左侧的"J2SE-1.5",然后在右侧点选"jdk1.6.0_38"。如下图
重启Eclipse,一切OK了。
另外,在eclipse.ini文件中加了两行(一定要加在-vmargs之前,而且-vm后面有回车):
-vm E:/Java/jdk1.6.0_38/bin/javaw.exe