Cocould not find artifact com. Sun: Tools: jar: 1.5.0 Solution

Source: Internet
Author: User

[Maven package], the error is still reported, but another error is reported:
[Info] scanning for projects... [Info]
[Info] building struts 2 blank webapp 1.0-Snapshot [info]
[Info] Build failure [info]
[Info] total time: 0.547 s [info] finished at: Wed APR 13 13:09:48 CST 2011 [info] final memory: 2 m/4 m [info]
[Error] failed to execute goal on Project my_struts: cocould not resolve dependencies for project Ricki. Cheung. Struts: my_struts: War: 1.0-snapshot: cocould 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

After finding a solution on the Internet, some foreign users said that you can add the following dependency to 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>

However, I have tried it, but another foreign user said that I should change [windows]-[Preferences]-[Java]-[install jres] in eclipse to JDK instead of JRE, as shown in:

Although I checked JDK, I still reported an error. After reading the error, I found it in c: \ Program Files \ Java \ jre1.6.0 _ 01 /.. /lib/tools. jar cannot find tools: jar, which makes me a little confused. I have already chosen JDK. How can I find it in JRE,So I removed the JRE from [windows]-[Preferences]-[Java]-[install jres] and [Maven package] again..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.