com.sun:tools:jar:在roo中运行“perform eclipse”时缺少1.4.2

当我在Roo中运行“执行日食”时,我得到:

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

尝试下载工具-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_HOME重新指向JDK(1.5+)目录而不是JRE。

根据Spring Source Roo和缺少的com.sun:tools:jar:1.4.2 :

如果您正在尝试使用x64 Java JDK(例如最新的JDK 1.6更新20)来运行最新版本的SpringSource ROO,那么遗憾的是缺少来自JDK的默认lib\目录的tools.jar(tut tut tut)太阳/ Oracle)的。 这将阻止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进程

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

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

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

   com.sun tools 1.4.2 system C:/Program Files/Java/jdk1.6.0_30/lib/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