簡體   English   中英

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

[英]com.sun:tools:jar:1.4.2 missing when running “perform eclipse” in roo

當我在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文件中添加此依賴項。

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

我也有類似的問題,並通過以下方式修復。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM