pom文件miss artifact com.sun:tools:jar:1.5.0:system问题

问题现象

导入新的maven项目时,有时候pom.xml文件会提示一个错误信息:Missing artifact com.sun:tools:jar:1.5.0:system

问题原因

maven是需要使用Jdk中的tools工具,而eclipse使用的是jre的运行环境,导致maven无法找到Jdk工具包tools.jar

解决方法

1>将eclipse修改为jdk目录中的javaw作为启动环境。步骤可以参看另一篇博客:

2>在pom.xml中添加java.home属性节点,以及com.sun.tools依赖节点。

pom文件miss artifact com.sun:tools:jar:1.5.0:system问题

时间: 2024-08-05 18:13:49

pom文件miss artifact com.sun:tools:jar:1.5.0:system问题的相关文章

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

今天同事在使用eclipse,引入一个新的maven工程时报错:      Missing artifact com.sun:tools:jar:1.6.0:system   这个问题很奇怪,相同的代码,运行到我本地的Eclipse中时,没有发现问题,说明应该是环境配置的问题.(JDK?maven,Eclipse?) 从网上找了很多资料,发现大家大部分都只给出了解决方案,没有给出出现此问题的原因. 从maven的官网上看:http://maven.apache.org/general.html#

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.iflytek.whshgl:whshgl-report:war:0.0.1-SNAPSHOT: Could not find artifact com.sun:tools:jar:1.5.0 at specified path C:\java\jre/../lib/tools.jar <dependen

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

修改maven的pom文件指定 a.定义属性<properties><java.home>C:\Program Files\Java\jdk1.6.0_21</java.home></properties> b.加入一个 dependency<dependency><groupId>com.sun</groupId><artifactId>tools</artifactId><version&

Missing artifact com.sun:tools:jar:1.5.0

今天下了导入maven工程之后,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本地仓库,并改名

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

前一阵子下了最新的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

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

前一阵子下了最新的JavaEE版本的eclipse,导入maven工程之后,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.

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

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

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

Missing artifact com.sun:tools:jar 1.7.0 解决办法一: 手动配置pom.xml,添加一个dependency如下: <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <scope>system</scope> <systemPath>${JAVA_HOME}/../lib/tool

【转自】Missing artifact com.sun:tools:jar 1.5.0 终极解决方法

在使用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>