前一阵子下了最新的JavaEE版本号的eclipse,导入mavenproject之后,pom文件一直报Missing artifact com.sun:tools:jar:1.5.0。非常纳闷,tools.jar是jdk自带的jar包。查了一下pom依赖图,原来是struts-core依赖了这个jar包。

试了网上的各种方法,仅仅有把jdk的tools.jar拷贝到本地仓库,报错才消失。

详细解决的方法例如以下:

把D:\Program Files (x86)\Java\jdk1.6.0_10\lib\tools.jar文件拷贝到maven本地仓库,并改名字。改成tools-1.5.0.jar。然后为这个jar包编写pom文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><modelVersion>4.0.0</modelVersion><groupId>com.sun</groupId><artifactId>tools</artifactId><version>1.5.0</version>
</project>

最后在报错的pom.xml文件中头加入对应的maven依赖:

<dependency><groupId>com.sun</groupId><artifactId>tools</artifactId><version>1.5.0</version></dependency>

这样pom文件就不报错了。

Missing artifact com.sun:tools:jar:1.5.0解决的方法相关推荐

  1. 开发常见错误之 :Missing artifact com.sun:tools:jar 1.7.0

    Missing artifact com.sun:tools:jar 1.7.0 解决办法一: 手动配置pom.xml,添加一个dependency如下: <dependency> < ...

  2. Missing artifact com.sun:tools:jar:1.5.0

    1. eclipse 突然爆出这种错误,来看看解决方案 原因:这是由于eclipse会默认使用自己的JAVA_HOME.因此才会包Missing artifact com.sun:tools:jar: ...

  3. 解决Missing artifact com.sun:tools:jar:1.5.0方法

    今天在pom文件里加了,然后项目就报Missing artifact com.sun:tools:jar:1.5.0错误了. 解决方法如下,在pom文件里加入 然后在加入tools依赖: 完美解决! ...

  4. 【Java开发问题】对象封装+固定排序+list All elements are null引起的异常处理+Missing artifact com.sun:tools:jar:1.8.0

    why 开发问题并不是经常遇到的,有技术问题,也有业务问题,记录一下,以备不时之需. 1 对象封装 将B类型的对象封装成A类型的对象,常用于Map对象封装成Entity对象,这里有Gson和JSON两 ...

  5. Eclipse maven工程 Missing artifact com.sun:tools:jar:1.5.0:system 解决方法

    今天同事在使用eclipse,引入一个新的maven工程时报错: Missing artifact com.sun:tools:jar:1.6.0:system 这个问题很奇怪,相同的代码,运行到我本 ...

  6. Could not find artifact com.sun:tools:jar:1.5.0 解决办法

    2019独角兽企业重金招聘Python工程师标准>>> Could not find artifact com.sun:tools:jar:1.5.0 解决办法 创建maven项目出 ...

  7. Missing artifact com.sun tools.jar 1.5.0 system 解决方法

    解决:maven中引用JDK中的tools.jar 方案一 通过maven获取运行时参数,eclipse提供的环境变量,基本类似System.getProperty("java.home&q ...

  8. Missing artifact com.sun:tools:jar 1.5.0 终极解决方法

    http://hw1287789687.iteye.com/blog/1946396 转载于:https://www.cnblogs.com/sj521/p/5950602.html

  9. Could not find artifact com.sun:tools:jar:1.5.0

    问题: Failed to execute goal on project petroleum: Could not resolve dependencies for project petroleu ...

最新文章

  1. OLAP是什么意思?
  2. Android Studio配置GreenDAO 3.2.0和使用方法
  3. We will be discontinuing the Nitrous Development Platform and Cloud IDE on November 14th, 2016.
  4. mysql什么情况会刷脏页_mysql-刷脏页(12)
  5. IE下 显示图片会多出一个边框的问题
  6. Linux设备驱动01:Linux设备驱动概述
  7. 开公司的两个方向,要么把公司开成很赚钱,要么把公司做成很值钱
  8. pat1091. Acute Stroke (30)
  9. (八)ASP.NET自定义用户控件(1)
  10. Android Studio and Gradle are using different locations for the JDK
  11. 出现红字是电脑问题吗_婚姻出现问题,生个孩子就能解决,这是真的吗?
  12. python中正则表达式_Python中正则表达式详解
  13. 机器数.原码 反码 补码比较理解
  14. Java8 Stream新特性详解及实战
  15. python微信聊天机器人_Python搭建一个微信聊天机器人
  16. excel表格中怎样让某一行数据一直显示
  17. camille mumu 模拟器 frida 踩坑记录
  18. 网站pv和uv比例多少合适
  19. JavaScript---网络编程(12)--DHTML技术演示(5)-form表单验证技术(正则)
  20. 软件自动升级解决方案(一)

热门文章

  1. Kafka性能测试实例
  2. Java中什么时候使用extends,什么时候使用implements?
  3. Android 升级到Android Studio2.2 后打不开以前版本的项目
  4. 删除linux系统中的eth0.bak与多余的网卡
  5. Linux 命令(129)—— passwd 命令
  6. db2执行sql脚本
  7. ARP-地址解析协议
  8. 【转载】 C#中使用int.TryParse方法将字符串转换为整型Int类型
  9. K8s运行dashboard命令启动报错:no endpoints available for service \kubernetes-dashboard\
  10. 洛谷2486 【SDOI2011】染色(线段树+树链剖分)