com.sun:tools:jar:1.4.2 missing when running “perform eclipse” in roo

为君一笑 提交于 2019-12-05 11:10:46

Repoint your system environment parameter JAVA_HOME to JDK (1.5+) directory instead of JRE.

According to Spring Source Roo and missing com.sun:tools:jar:1.4.2:

If you are trying to get the latest version of SpringSource ROO working, with an x64 Java JDK, such as the latest JDK 1.6 update 20, there is unfortunately a missing tools.jar from the default lib\ directory of the JDK (tut tut tut Sun/Oracle). This will prevent Roo from working and therefore prevent Maven compilation. You would probably see an error similar to this:

Error message: Missing:
----------
1) com.sun:tools:jar:1.4.2

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

----------
1 required artifact is missing.

To correct this error, install an additional x86 JDK, repoint the JAVA_HOME and the PATH to the new JDK and restart the mvn process

i thought i had java_home set to jdk, but i guess in slackware both jre and jdk get installed in same folder. having both installed caused this problem. i uninstalled both, and reinstalled jdk (to be safe) and it fixed it.

Divyang Patel

Add this dependecy in pom.xml file.

in the <systemPath> property you have to write your JDK lib path.

    <dependency>  
          <groupId>com.sun</groupId> 
           <artifactId>tools</artifactId>
        <version>1.4.2</version>
        <scope>system</scope>
        <systemPath>C:/Program Files/Java/jdk1.6.0_30/lib/tools.jar</systemPath>
    </dependency> 

I also had a similar issue and fixed int the following way.

Go to lib directory of JDK installed path in command prompt. Execute the below command to install to install tools.jar. $mvn install:install-file -DgroupId=sun.jdk -DartifactId=tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar

http://parameshk.blogspot.in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!