【maven package】,则依然报错,但报的是另外一个错误:
[INFO] Scanning for projects…[INFO]
[INFO] Building Struts 2 Blank Webapp 1.0-SNAPSHOT[INFO]
[INFO] BUILD FAILURE[INFO]
[INFO] Total time: 0.547s[INFO] Finished at: Wed Apr 13 13:09:48 CST 2011[INFO] Final Memory: 2M/4M[INFO]
[ERROR] Failed to execute goal on project my_struts: Could not resolve dependencies for project ricki.cheung.struts:my_struts:war:1.0-SNAPSHOT: Could not
find artifact com.sun:tools:jar:1.5.0 at specified path C:\Program Files\Java\jre1.6.0_01/../lib/tools.jar -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable
full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
后在网上查找解决方法,有外国网友说,在pom.xml添加如下依赖即可:
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
不过,我试过还是不行,另一个外国网友说,把eclipse中的【Windows】-【Preferences】-【Java】-【Install JREs】改为JDK,而不用JRE,如下图所示:
虽然我勾选了JDK,但还是报错,看了错误,发现在 C:\Program Files\Java\jre1.6.0_01/../lib/tools.jar无法找到tools:jar,这让我有点纳闷了,明明已经选了使用JDK了,怎么还去JRE那里找呢,于是我把【Windows】-【Preferences】-【Java】-【Install JREs】中的JRE给remove掉,再次【maven package】就OK了。
分享到:
相关推荐
Missing artifact com.babasport:page:jar:1.0Missing artifact com.babasport:page:jar:1.0
Missing artifact com.oracle:ojdbc6:jar:11.2.0.1.0问题解决 ojdbc包pom.xml出错 <!-- oracle数据库驱动 --> <groupId>com.oracle</groupId> <artifactId>ojdbc6 <version>11.2.0.1.0 1.首先确定你...
ojdbc6-11.2.0.1.0 解决问题: Could not find artifact com.oracle:ojdbc6:pom:11.2.0.1.0
Could not resolve dependencies for project org.apache.flink:flink-avro-confluent-registry:jar:1.15.3: Could not find artifact io.confluent:kafka-schema-registry-client:jar:6.2.2 in maven 安装本地...
解决maven引入hive的jar包时依赖报错Could not find artifact org.pentaho:pentaho-aggdesigner-algorithm:pom:5.1.5-jhyde in xxx的问题,maven路径org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/pentaho...
Failure to transfer org.... Original error: Could not transfer artifact org.codehaus.plexus:plexus-io:jar: 1.0.1 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000
com.springsource.org.aspectj.weaver-1.6.8.jar
ojdbc6-11.2.0.1.0jar,oracle连接ojdbc6-11.2.0.1.0jar
在maven中配置的阿里云仓库无法下载com.aspose:aspose:jar:19,所以自己找的资源,很麻烦,为了方便兄弟们给你们了。
缺少jar包 Description Resource Path Location Type Missing artifact com.sun.jdmk:jmxtools:jar:1.2.1 pom.xml Maven Dependency Problem jmxtools-1.2.1.jar
数据库连接包,下载解压,使用命令 mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.5.0 -Dpackaging=jar -Dfile=(你的路径)\ojdbc14.jar
在我们学习淘淘商城项目时候,导入系统项目,会出现Missing artifact com.github.pagehelper:pagehelper:jar:3. 错误
解决maven项目找不到tools-1.8.0.jar的问题,缺失tools-1.8.0.jar包
Description Resource Path Location Type Missing artifact com.sun.jmx:jmxri:jar:1.2.1 pom.xml /eshop-storm line 2 Maven Dependency Problem
Could not find artifact org.apache.phoenix:phoenix-core:jar:4.4.0.2.3.4.0-3347,或者hbase、grafana、hadoop 和官方的其实是一样的,放心下载, 原名称是grafana-2.6.0.linux-x64.tar.gz,改下包名即可
Missing artifact com.oracle:ojdbc14:jar:10.2.0.3.0-附件资源
org / pentaho / pentaho-aggdesigner-algorithm / 5.1.5-jhyde / pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar,解决maven引入hive的jar包时依赖报错Could not find artifact org.pentaho:pentaho-aggdesigner-...
aspose-words-jdk16-14.9.0 maven仓库没有的版本,需要手动添加到仓库,附上命令:install:install-file -Dfile="H:\\14.9.0\\aspose-words-jdk16-14.9.0.jar" -DgroupId=...
主要介绍了解决java maven项目找不到jconsole-1.8.0.jar和tools-1.8.0.jar包问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧