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

来源:互联网 发布:linux 定时重启服务器 编辑:程序博客网 时间:2024/06/06 04:04

maven install时出现该问题:

把eclipse中的【Windows】-【Preferences】-【Java】-【Install JREs】改为JDK,而不用JRE

还要讲项目的环境也改为jdk,在项目上右键-属性---java构建路径---库---点击jre系统库---编辑---在备用的jre中选择jdk

在pom.xml中出现该问题:


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">  <properties>        <java.home>C:\Program Files\Java\jdk1.6.0_02</java.home> <!-- 指定使用的JDK的安装目录 -->  </properties>  

。。。。

 <dependencies>  <!-- 避免出现 Could not find artifact com.sun:tools:jar:1.5.0问题 -->  <dependency>        <groupId>com.sun</groupId>        <artifactId>tools</artifactId>        <version>1.5.0</version>        <scope>system</scope>        <systemPath>${java.home}/lib/tools.jar</systemPath>  </dependency>    




原创粉丝点击