Eclipse maven工程 Missing artifact com.sun:tools:jar:1.6.0:system 解决方法
来源:互联网 发布:5.10沙恩霍斯特数据 编辑:程序博客网 时间:2024/06/05 14:30
解决方案一
通过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 没有使用 JAVA_HOME
默认,eclipse 使用 C:"windows"system32"javaw.exe 作为 JVM,当然找不到tools.jar
解决方法如下: 修改 eclipse.exe 目录下的 eclipse.ini 指定vm,注意 -vm后面不能有空格。
-vmD:\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>
通过profile来设置,方便决定是否启用
解决方案三:
<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>
直接使用Maven获取系统的环境变量
- Eclipse maven工程 Missing artifact com.sun:tools:jar:1.6.0:system 解决方法
- Eclipse maven工程 Missing artifact com.sun:tools:jar:1.6.0:system 解决方法
- Eclipse maven工程 Missing artifact com.sun:tools:jar:1.6.0:system 解决方法
- Eclipse maven工程 Missing 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.5.0:system 解决方法
- Missing artifact com.sun:tools:jar:1.5.0:system 解决方法
- Missing 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.5.0:system之完美解决 (2)
- Missing artifact com.sun:tools:jar:1.5.0:system 补充
- Missing artifact com.sun:tools:jar:1.5.0:system
- Missing artifact com.sun:tools:jar:1.5.0:system解决办法
- Missing artifact com.sun:tools:jar:1.5.0:system 问题
- Missing artifact com.sun:tools:jar:1.5.0:system
- Missing artifact com.sun:tools:jar:1.5.0:system
- 【Maven】Missing artifact com.sun:tools:jar:1.5.0
- maven Missing artifact com.sun:tools:jar:1.5.0
- 程显峰:写一份好简历
- ExtJs之Ext.data.Store
- VB.net类库中应用log4net实现日志记录(文件形式)
- visual studio MFC 基于google map的应用
- Myeclipse Jquery代码提示
- Eclipse maven工程 Missing artifact com.sun:tools:jar:1.6.0:system 解决方法
- View的可见与不可见
- 为Ubuntu虚拟机添加虚拟硬盘
- 【Q&A】11月27日移动技术公开课《Mobile Runtime SDKs,开启移动开发的炫彩之旅》 Q&A
- Android 监听安装和卸载
- java AtomicInteger 类详细解释
- 分析优酷HTML5地址
- 现场总线分类
- python 解析XML xml.dom