在使用m2eclipse插件时,在pom.xml中添加struts2-core.jar包后,需要依赖java运行时的tools.jar进行依赖。但是,此时eclipse无法读取tools包,出现如下错误:

Missing artifact com.sun:tools:jar 1.5.0

解决办法一:

手动配置pom.xml,添加一个dependency如下:

<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<scope>system</scope>
<systemPath>${JAVA_HOME}/../lib/tools.jar</systemPath>
</dependency>

即可!

如果办法不能解决,试用第二种方法。

解决办法二:

首先,查看错误列表windows->Show View->Problems,在有以上问题的同时,还会出现该错误。
The container 'Maven Dependencies' references non existing library 'C:\Documents and Settings\DELL\.m2\repository\com\sun\tools\1.5.0\tools-1.5.0.jar'
大致说:找不到该tools-1.5.0.jar。

所以将C:\Program Files\Java\jdk1.6.0_10\lib\目录下的tools.jar拷贝到C:\Documents and Settings\DELL\.m2\repository\com\sun\tools\1.5.0\目录下,并将tools.jar改名为tools-1.5.0.jar,并在pom.xml中作如下配置:

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

Missing artifact com.sun:tools:jar 1.5.0 终极解决方法的更多相关文章

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

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

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

    解决方案一:通过maven取运行时参数,eclipse提供的环境变量,基本类似System.getProperty("java.home") <dependency> ...

  3. Maven错误-Missing artifact com.sun:tools:jar:1.5.0:system 解决方式

    1.Missing artifact com.sun:tools:jar:1.5.0:system Could not resolve dependencies for project com.ifl ...

  4. Missing artifact com.sun:tools:jar:1.5.0的解决方案

    今天在用maven的时候遇到一个问题pom.xml提示Missing artifact com.sun:tools:jar:1.5.0 试过改eclipse的eclipse.ini文件,也试过在ecl ...

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

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

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

    前一阵子下了最新的JavaEE版本号的eclipse,导入mavenproject之后,pom文件一直报Missing artifact com.sun:tools:jar:1.5.0.非常纳闷,to ...

  7. maven Missing artifact com.sun:tools:jar:1.5.0

    转自:http://blog.csdn.net/caolaosanahnu/article/details/7918929 http://zuoshahao.com/work/others/missi ...

  8. Missing artifact com.sun:tools:jar:1.5.0:system 补充

    转自:http://blog.csdn.net/sweblish/article/details/6662586 解决方案一: 原来,是${java.home}在作怪,eclipse 没有使用 JAV ...

  9. Maven解决Missing artifact com.sun:tools:jar:1.5.0错误

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

随机推荐

  1. jsp页面直接编写csss

    <style> .logoZL{ width:550px; float:right; text-align:right; padding-right:15px; margin-right: ...

  2. 使用AJAX做关键字查询:输入框变化自动搜索、无刷新页面;

    使用AJAX做关键字查询要求:1.无刷新页面2.输入框变化自动搜索 <style type="text/css"> .k{ width:150px; height:30 ...

  3. Makefile 如何轻松搞定

    最近在学习Linux下的C编程,买了一本叫<Linux环境下的C编程指南>读到makefile就越看越迷糊,可能是我的理解能不行. 于是google到了以下这篇文章.通俗易懂.然后把它贴出 ...

  4. zepto源码--extend--学习笔记

    对象继承函数: $.extend(){},默认传递一个参数,需要继承的对象目标.函数展示: 最终实现的过程,需要调用工具函数extend,首先分析extend函数. 默认传递三个参数,继承的目标对象- ...

  5. php--在apache上配制rewrite重写

    配置步骤: 第一步:找到apache的配置文件httpd.conf(文件在conf目录下) 第二步:你首先必须得让服务器支持mod_rewrite,如果你使用的是虚拟主机,请事先询问你的主机提供商. ...

  6. CSS弹性盒布局

    <html> <head> <meta charset="utf-8"/> <title></title> <st ...

  7. RESTFul Web Api 服务框架(一)

    简介: 基于 REST 的 Web 服务日益成为后端企业服务集成的首选,因为它比 SOAP 更加简单.这篇文章介绍了一 个简单的可扩展框架,使用Asp.net Web Api作为 REST 服务的实现 ...

  8. css背景图片定位练习(二): background-position的百分比

    background-position:x y; 百分比定位并不能直观的看出来,需要通过计算. background-position百分比计算公式: (容器宽度—背景图片的宽度)*x%=xpx(容器 ...

  9. SQL语句创建表和数据库

      删除数据库,SQL Server将数据库的清单存放在master系统数据库的sysdatabases表中,只需要查看该表是否存在于该数据库中就可以了,语句如下: use master -- 设置当 ...

  10. mysql中varchar(50)最多能存多少个汉字

    首先要确定mysql版本4.0版本以下,varchar(50),指的是50字节,如果存放UTF8汉字时,只能存16个(每个汉字3字节) 5.0版本以上,varchar(50),指的是50字符,无论存放 ...