Eclipse Maven Engineering Missing Artifact Com.sun:tools:jar:1.7.0:system workaround

Source: Internet
Author: User

Solution one: With maven fetching runtime parameters, Eclipse provides environment variables that are basically similar to System.getproperty ("Java.home")

  1. <dependency>
  2. <groupId>com.sun</groupId>
  3. <artifactid>tools</artifactid>
  4. <version>1.5.0</version>
  5. <scope>system</scope>
  6. <systempath>${java.home}/lib/tools.jar</systempath>
  7. </Dependency>

If it doesn't work, $ (java.home) Eclipse resolves the wrong, eclipse does not use java_home default, Eclipse uses C: "Windows" System32 "Javaw.exe as the JVM, Of course I can't find Tools.jar.

The workaround is as follows: Modify the Eclipse.ini specified VM under the Eclipse.exe directory, note that there is no space behind-VM.

    1. -vm
    2. D:\Program Files\java\jdk1. 6.0_23\bin\javaw.exe
    3. -vmargs
    4. -dosgi.requiredjavaversion=1.6
    5. -xms40m
    6. -xmx512m
    7. -xx:permsize=64m
    8. -xx:maxpermsize=512m

Note: To write in two lines, write on a line that does not take effect
Note: These two lines will not be valid until-vmargs.

Solution Two:

  1. <properties>
  2. <project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
  3. <java.home>c:\program Files\java\jdk1. 6.0_25</java.home>
  4. </properties>
  5. <profiles>
  6. <profile>
  7. <id>default-tools.jar</id>
  8. <activation>
  9. <activeByDefault>true</activebydefault>
  10. <property>
  11. <name>java.vendor</name>
  12. <value>sun Microsystems Inc.</value>
  13. </property>
  14. </activation>
  15. <dependencies>
  16. <dependency>
  17. <groupId>com.sun</groupId>
  18. <artifactId>tools</artifactId>
  19. <version>1.5. 0</version>
  20. <scope>system</scope>
  21. <systemPath>${java.home}/lib/tools.jar</systemPath>
  22. </dependency>
  23. </dependencies>
  24. </profile>
  25. </profiles>
Set by profile to make it easy to decide whether to enable solution three:
    1. <dependency>
    2. <groupId>com.sun</groupId>
    3. <artifactId>tools</artifactId>
    4. <version>1.6. 0</version>
    5. <scope>system</scope>
    6. <systempath>${env. Java_home}/lib/tools.jar</systempath>
    7. <optional>true</optional>
    8. </dependency>
Get the environment variables for your system directly using MAVEN

Eclipse Maven Engineering Missing Artifact Com.sun:tools:jar:1.7.0:system workaround

Related Article

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.