天天看点

maven2集成struts2开发遇到的问题

最近到用eclipse通过maven2集成ssh开发, 当添加struts2-core的依赖时报了如下错误, 还在疑惑中...

[ERROR] Failed to execute goal on project Prjssh: [color=darkred]Could not resolve dependencies for project com.fei.ssh:Prjssh:war:1.0-SNAPSHOT: Could not find artifact com.sun:tools:jar:1.5.0 at specified path C:\Program Files\Java\jre6/../lib/tools.jar ->[/color] [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

着实让我google了几天, 问题几天前解决了, 是因为java 运行环境(jre)的问题, 在java的安装目录下面有两个j一样的jre, 但是eclipse启动的时候用的C:\Program Files\Java\jdk1.6.0_21\jre, 而工程build path用的是C:\Program Files\Java\jre6, 虽然他们一样,但是互相引用不到, 把它们设置一至的就可以把问题解决