Eclipse maven工程 Missing artifact com.sun:tools:jar:1.7.0:system 解决方法
解决方案一:通过maven取运行时参数,eclipse提供的环境变量,基本类似System.getProperty("java.home")
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
- <scope>system</scope>
- <systemPath>${java.home}/lib/tools.jar</systemPath>
- </dependency>
如果不起作用的话,$(java.home)eclipse解析的不对,eclipse 没有使用 JAVA_HOME 默认,eclipse 使用 C:"windows"system32"javaw.exe 作为 JVM,当然找不到tools.jar
解决方法如下: 修改 eclipse.exe 目录下的 eclipse.ini 指定vm,注意 -vm后面不能有空格。
- -vm
- D:\Program Files\Java\jdk1.6.0_23\bin\javaw.exe
- -vmargs
- -Dosgi.requiredJavaVersion=1.6
- -Xms40m
- -Xmx512m
- -XX:PermSize=64M
- -XX:MaxPermSize=512M
注意: 要写在两行,写在一行不能生效
注意: 这两行要定在-vmargs之前,不然也不能生效
解决方案二:
- <properties>
- <project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
- <java.home>C:\Program Files\Java\jdk1.6.0_25</java.home>
- </properties>
- <profiles>
- <profile>
- <id>default-tools.jar</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- <property>
- <name>java.vendor</name>
- <value>Sun Microsystems Inc.</value>
- </property>
- </activation>
- <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>
- </profile>
- </profiles>
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.6.0</version>
- <scope>system</scope>
- <systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath>
- <optional>true</optional>
- </dependency>
Eclipse maven工程 Missing artifact com.sun:tools:jar:1.7.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 这个问题很奇怪,相同的代 ...
- 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 ...
- 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:system 补充
转自:http://blog.csdn.net/sweblish/article/details/6662586 解决方案一: 原来,是${java.home}在作怪,eclipse 没有使用 JAV ...
- 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 ...
- 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 ...
- Missing artifact com.sun:tools:jar:1.5.0解决的方法
前一阵子下了最新的JavaEE版本号的eclipse,导入mavenproject之后,pom文件一直报Missing artifact com.sun:tools:jar:1.5.0.非常纳闷,to ...
- 开发常见错误之 :Missing artifact com.sun:tools:jar 1.7.0
Missing artifact com.sun:tools:jar 1.7.0 解决办法一: 手动配置pom.xml,添加一个dependency如下: <dependency> < ...
- maven Missing artifact com.sun:tools:jar:1.5.0
转自:http://blog.csdn.net/caolaosanahnu/article/details/7918929 http://zuoshahao.com/work/others/missi ...
随机推荐
- ro多层的事务处理失败的困惑
现象: 用 :: ::'' 在客户端用上面的语句取得数据,然后修改数据,通过RO的web service提交数据失败: 用 -- ::-- ::'‘ 在客户端用上面的语句取得数据,然后修改数据,通过R ...
- mysql use index () 优化查询的例子
USE INDEX在你查询语句中表名的后面,添加 USE INDEX 来提供你希望 MySQ 去参考的索引列表,就可以让 MySQL 不再考虑其他可用的索引.Eg:SELECT * FROM myta ...
- 念念不忘SERVLET
这个弄弄也有意思,以前无法入门,没有系统性概念,现在慢慢开始懂了.. 这个SERVLET/JSP学习笔记也易懂.. 那个JAVA7程序设计也可以慢慢看来,, 再加上SPRING,我黑心了??:) pa ...
- ThreadPoolExecutor源码分析(一)
一.前言 闲来无事,博主有重新翻看了一下jdk1.8版的ThreadPoolExecutor源码,看后写此笔记,画个圈圈,做个记录,这段源码,我看过,到处一游,嘻嘻~~ 二.ThreadPoolExe ...
- HDU 4506
EASY题,快速幂... #include <iostream> #include <cstdio> #include <cstring> #include < ...
- configure: error: XML configuration could not be found
运行: ./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm 之后出现 Running FastCGI Process M ...
- [Javascript] Getter and Setter Abstractions
JavaScript provides primitive types and means of processing those. However, those are not enough. Re ...
- TRIZ系列-创新原理-8-重量补偿原理
重量补偿原理的表述例如以下: 1)将某一物体与还有一种提供上升力的物体组合,以补偿其重量:2)通过与环境(利用空气动力,流体动力或其他力等)的相互作用.实现对物体的重量补偿: 重力使得我们能够稳稳的依 ...
- 301 和 302 对 SEO 的影响
网站优化中,经常会面临网站链接修改或改变的事情,其中一个解决办法就是使用网站跳转的方式,处理变化的链接,下面讲述301和302跳转对SEO的影响. 301(永久移动) 请求的网页已被永久移动到新位置. ...
- 复制DropDownList
DropDownList ddlA; ListItem[] ar = new ListItem[ddlB.Items.Count]; ddlB.Items.CopyTo(ar,0); ddlA.Dat ...