java com.sun:tools:jar:1.4.2 在 roo 中运行“perform eclipse”时丢失

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3356716/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 01:28:05  来源:igfitidea点击:

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

javamaven-2spring-roo

提问by jorgen.ringen

When I run "perform eclipse" in Roo I get:

当我在 Roo 运行“perform eclipse”时,我得到:

roo> perform eclipse
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building bugzter
[INFO]    task-segment: [eclipse:clean, eclipse:eclipse]
[INFO] ------------------------------------------------------------------------
[INFO] [eclipse:clean {execution: default-cli}]
[INFO] Deleting file: .project
[INFO] Deleting file: .classpath
[INFO] Deleting file: .wtpmodules
[INFO] Deleting file: .component
[INFO] Deleting file: org.eclipse.wst.common.component
[INFO] Deleting file: org.eclipse.wst.common.project.facet.core.xml
[INFO] Deleting file: org.eclipse.jdt.core.prefs
[INFO] Deleting file: org.eclipse.ajdt.ui.prefs
[INFO] Preparing eclipse:eclipse
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

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]

  Path to dependency: 
      1) org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0
      2) com.sun:tools:jar:1.4.2

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

for artifact: 
  org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0

from the specified remote repositories:
  com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release),
  com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external),
  central (http://repo1.maven.org/maven2),
  codehaus.org (http://repository.codehaus.org),
  com.springsource.repository.bundles.milestone (http://repository.springsource.com/maven/bundles/milestone),
  com.springsource.repository.bundles.snapshot (http://repository.springsource.com/maven/bundles/snapshot),
  snapshots (http://snapshots.repository.codehaus.org)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Jul 28 20:57:52 CEST 2010
[INFO] Final Memory: 30M/298M
[INFO] ------------------------------------------------------------------------

Tried downloaded the tools-1.4.2.jar and run mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file but it doesn't solve the problem.

尝试下载 tools-1.4.2.jar 并运行 mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file 但它没有不解决问题。

Running ubuntu 10.04 and maven 2.2

运行 ubuntu 10.04 和 maven 2.2

Any suggestions?

有什么建议?

回答by Damior

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

将您的系统环境参数 JAVA_HOME 重新指向 JDK (1.5+) 目录而不是 JRE。

回答by Pascal Thivent

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

根据Spring Source Roo 和缺少的 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

如果您正在尝试使用 x64 Java JDK(例如最新的 JDK 1.6 update 20)使最新版本的 SpringSource ROO 正常工作,那么不幸的是,JDK 的默认lib\目录中缺少一个 tools.jar (啧啧啧 Sun/甲骨文)。这将阻止 Roo 工作,从而阻止 Maven 编译。您可能会看到与此类似的错误:

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.

要更正此错误,请安装额外的 x86 JDK,将 JAVA_HOME 和 PATH 重新指向新的 JDK 并重新启动 mvn 进程

回答by mdeanda

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.

我以为我将 java_home 设置为 jdk,但我猜在 slackware 中 jre 和 jdk 都安装在同一个文件夹中。两者都安装导致了这个问题。我卸载了两者,并重新安装了 jdk(为了安全)并修复了它。

回答by Divyang Patel

Add this dependecy in pom.xml file.

在 pom.xml 文件中添加此依赖项。

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

<systemPath>属性中,您必须编写 JDK lib 路径。

    <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> 

回答by Paramesh Korrakuti

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

我也遇到了类似的问题并通过以下方式修复了 int 。

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

在命令提示符下转到 JDK 安装路径的 lib 目录。执行以下命令安装以安装tools.jar。$mvn install:install-file -DgroupId=sun.jdk -DartifactId=tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar

http://parameshk.blogspot.in

http://parameshk.blogspot.in