Could not find artifact com.sun:tools:jar:1.5.0 问题解决
来源:互联网 发布:快牙软件 编辑:程序博客网 时间:2024/06/06 14:16
【maven package】,则依然报错,但报的是另外一个错误:
[INFO] Scanning for projects…[INFO]
[INFO] Building Struts 2 Blank Webapp 1.0-SNAPSHOT[INFO]
[INFO] BUILD FAILURE[INFO]
[INFO] Total time: 0.547s[INFO] Finished at: Wed Apr 13 13:09:48 CST 2011[INFO] Final Memory: 2M/4M[INFO]
[ERROR] Failed to execute goal on project my_struts: Could not resolve dependencies for project ricki.cheung.struts:my_struts:war:1.0-SNAPSHOT: Could not
find artifact com.sun:tools:jar:1.5.0 at specified path C:\Program Files\Java\jre1.6.0_01/../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] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
后在网上查找解决方法,有外国网友说,在pom.xml添加如下依赖即可:
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
不过,我试过还是不行,另一个外国网友说,把eclipse中的【Windows】-【Preferences】-【Java】-【Install JREs】改为JDK,而不用JRE,如下图所示:
虽然我勾选了JDK,但还是报错,看了错误,发现在 C:\Program Files\Java\jre1.6.0_01/../lib/tools.jar无法找到tools:jar,这让我有点纳闷了,明明已经选了使用JDK了,怎么还去JRE那里找呢,于是我把【Windows】-【Preferences】-【Java】-【Install JREs】中的JRE给remove掉,再次【maven package】就OK了。
- Could not find artifact com.sun:tools:jar:1.5.0
- Could not find artifact com.sun:tools:jar:1.5.0 问题解决
- Could not find artifact com.sun:tools:jar:1.5.0问题解决
- Could not find artifact com.sun:tools:jar:1.5.0 问题解决
- maven: Could not find artifact com.sun:tools:jar:1.5.0
- Could not find artifact com.sun:tools:jar:1.5.0解决方法
- Missing artifact com.sun:tools:jar:1.5.0 问题解决
- Missing artifact com.sun:tools:jar:1.5.0:system 补充
- Missing artifact com.sun:tools:jar:1.5.0:system
- Missing artifact com.sun:tools:jar:1.5.0:system解决办法
- Missing artifact com.sun:tools:jar:1.5.0
- 【Maven】Missing artifact com.sun:tools:jar:1.5.0
- Missing artifact com.sun:tools:jar 1.5.0 终极解决方法
- Missing artifact com.sun:tools:jar:1.5.0:system 问题
- pom.xml Missing artifact com.sun:tools:jar:1.5.0
- Missing artifact com.sun:tools:jar:1.5.0:system 解决方法
- maven Missing artifact com.sun:tools:jar:1.5.0
- Missing artifact com.sun:tools:jar 1.5.0 终极解决方法
- 常用的js方法,包括表单校验的一些方法,下拉菜单常用的方法
- 老外用5个理由说服你:苹果电视将会成功!
- 大数据查询时出现 org.hibernate.exception.GenericJDBCException: Cannot open connection 请求支援
- 晶振与晶体的参数详解
- 不是用它printf,将十进制数以二进制和十六进制的形式输出
- Could not find artifact com.sun:tools:jar:1.5.0 问题解决
- 用面向对象的编程方式写JavaScript
- 重构的一点看法
- Failed to install on device 'emulator-5554': timeout
- 最常用的JavaScript日期函数
- 决策树算法学习
- 分析DB2数据库的优势
- 《算法导论》 2.3.1分治法
- Vim学习之路