【问题标题】:com.sun:tools:jar:1.4.2 missing when running "perform eclipse" in roocom.sun:tools:jar:1.4.2 在房间中运行“执行 Eclipse”时丢失
【发布时间】:2010-07-28 19:33:26
【问题描述】:

当我在 Roo 中运行“执行 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] ------------------------------------------------------------------------

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

运行 ubuntu 10.04 和 maven 2.2

有什么建议吗?

【问题讨论】:

    标签: java maven-2 spring-roo


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      根据Spring Source Roo and missing com.sun:tools:jar:1.4.2

      如果您想获取最新的 SpringSource ROO 版本工作, 使用 x64 Java JDK,例如 最新的JDK 1.6 update 20,有 不幸的是,缺少 tools.jar JDK的默认lib\目录 (啧啧啧太阳/甲骨文)。这会 阻止 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 和新 JDK 的 PATH 并重启mvn进程

      【讨论】:

      • 我想知道是否值得检查 1.6 更新 21 以查看他们是否添加了它。可能不会。
      • @R.Bemrose:这当然值得检查,但我懒得在我的 32 位平台上安装 64 位 JDK。
      • 我必须记住我在家的时候...我在那里安装了 64 位 Java 6u21 JDK;尽管适用于 Windows。
      【解决方案3】:

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

      【讨论】:

        【解决方案4】:

        在 pom.xml 文件中添加这个依赖。

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

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

        【讨论】:

          【解决方案5】:

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

          在命令提示符下转到 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

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2020-04-13
            • 2018-04-06
            • 2011-09-05
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多