运行“执行 eclipse”时缺少 com.sun:tools:jar:1.4.2在罗奥

发布于 2024-09-11 16:02:20 字数 2996 浏览 10 评论 0原文

当我在 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] ------------------------------------------------------------------------

尝试下载了 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

有什么建议吗?

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

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.

Running ubuntu 10.04 and maven 2.2

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

女皇必胜 2024-09-18 16:02:20

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

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

勿忘初心 2024-09-18 16:02:20

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

如果您想获取最新的
SpringSource ROO 版本工作,
使用 x64 Java JDK,例如
最新的JDK 1.6更新20,有
不幸的是缺少tools.jar
JDK默认的lib\目录
(啧啧啧 Sun/Oracle)。这将
阻止 Roo 工作,因此
阻止 Maven 编译。你会
可能会看到类似这样的错误:

错误消息:缺少:
----------
1)com.sun:工具:jar:1.4.2

尝试从项目网站手动下载文件。

然后,使用以下命令安装它:
mvn install:安装文件 -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file

或者,如果您托管自己的存储库,则可以在那里部署该文件:
mvn 部署:部署文件 -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

----------
缺少 1 件必需的工件。

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

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

稚气少女 2024-09-18 16:02:20

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

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.

情话难免假 2024-09-18 16:02:20

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

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

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> 
与风相奔跑 2024-09-18 16:02:20

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

在命令提示符下进入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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文