Java com.sun:tools:jar:1.4.2运行时丢失;执行eclipse“;在鲁奥

Java com.sun:tools:jar:1.4.2运行时丢失;执行eclipse“;在鲁奥,java,maven-2,spring-roo,Java,Maven 2,Spring Roo,在Roo中运行“performeclipse”时,我得到: roo> perform eclipse [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building bugzter [INFO] task-segment: [eclipse:clean, eclipse:eclipse] [IN

在Roo中运行“performeclipse”时,我得到:

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安装:安装文件-DgroupId=com.sun-DartifactId=tools-Dversion=1.4.2-dpackage=jar-Dfile=/path/to/file,但它没有解决问题

运行ubuntu 10.04和maven 2.2

有什么建议吗

根据:

如果你想得到最新的消息 SpringSource ROO的版本正在运行, 使用x64 Java JDK,例如 最新的JDK1.6更新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_主页和新JDK的路径 然后重新启动mvn进程


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

我以为已经将JAVA_HOME设置为JDK,但我猜在slackware中,JRE和JDK都安装在同一个文件夹中。这两个都已安装导致了此问题。我卸载了这两个,重新安装了jdk(为了安全起见),并将其修复。

在pom.xml文件中添加此依赖关系

属性中,必须编写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> 

com.sun
工具
1.4.2
系统
C:/Program Files/Java/jdk1.6.0_30/lib/tools.jar

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

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


我想知道是否值得检查1.6 update 21,看看他们是否添加了它。可能不会。@R.Bemrose:这当然值得检查,但我太懒了,无法在我的32位平台上安装64位JDK。我必须记住我在家的时候。。。我在那里安装了一个64位Java6U21 JDK;尽管是窗户。