eclipse的maven项目报Missing artifact jdk.toos:jdk.toos:jar:1.6错

很多框架都会依赖jdk中的tools.jar,但是maven仓库中却没有.

如在eclipse+maven编写mapreduce代码,就会报Missing artifact jdk.toos:jdk.toos:jar:1.6

如何解决这个问题呢,只需要在项目的pom.xml 文件中加入以下配置,指定maven去本地寻找 tools.jar、

<dependency>
        <groupId>jdk.tools</groupId>
        <artifactId>jdk.tools</artifactId>
        <version>1.6</version>
        <scope>system</scope>
        <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
    </dependency>

注意:它报哪个版本你就写哪个版本。

时间: 2024-08-09 06:10:38

eclipse的maven项目报Missing artifact jdk.toos:jdk.toos:jar:1.6错的相关文章

Eclipse启动Maven项目报java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener的错误

今天用Eclipse导入了一个Maven项目,启动tomcat时却报java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener的错误.   解决办法:右键项目->properties->Deployment Assembly>Add->Java Build Path Entries->Next->Maven Dependencies->Finish.

eclipse运行maven项目报错java.lang.ClassNotFoundException: xxxxxx

在eclipse中运行maven项目,出现异常--java.lang.ClassNotFoundException: org.apache.shiro.web.env.EnvironmentLoaderListener.如果确认shiro相关的依赖jar无误,那么可以试着如下操作: 右键项目--build path--configure build path...--deployment assembly--add--java build path entries--maven dependen

解决eclipse创建maven项目报错!Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp

maveneclipse测试 我是使用代理上网的.在创建maven时报以下错误: Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories. 解决办法: 首先找到 config/settting.xml 在里面添加代理信息 ----------  这个是重点: <proxies><proxy&g

eclipse新建maven项目报错The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path的解决方案

具体表现为: 使用Eclipse+Maven建立了一个Javaweb工程,JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path. 解决方法: 在pom.xml中的  <build></build>中  添加: <plugins> <!-- 编码和编译和JDK版本 --> <plug

全盘解决eclipse之maven项目报错

每次新建maven的web(war包方式)项目时都会报错而且都要手动改,很麻烦 解决: 改变maven配置文件   settings.xml 在文件的<profiles></profiles>节点里面添加: <profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk&

解决eclipse下maven工程报错:Missing artifact jdk.tools:jdk

1.进入jdk/lib目录,执行: mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar -Dversion=1.7 -Dfile=tools.jar -DgeneratePom=true 2.加入依赖 <dependency> <groupId>jdk.tools</groupId> <artifactId>jdk.tools</arti

解决:eclipse或STS运行maven工程出现Missing artifact jdk.tools:jdk.tools:jar:1.7问题

eclipse或STS运行maven工程出现Missing artifact jdk.tools:jdk.tools:jar:1.7问题 最近项目中使用到大数据平台,代码中应用了hbase-client.0.98.6-hadoop2.jar包,该包中引用了jdk.tools.1.7,所以导致eclipse中pom.xml老是提示Missing artifact jdk.tools:jdk.tools:jar:1.7.从网上找了一下原因大多都说是工程maven找不到系统内的jdk1.7,根本原因是

Missing artifact net.sf.json-lib:json-lib:jar:2.4错误和Eclipse安装Maven插件错误

微信公众号:compassblog 欢迎关注.转发,互相学习,共同进步! 有任何问题,请后台留言联系! 1.配置Maven项目的pom.xml文件报错 (1).错误描述:Missing artifact net.sf.json-lib:json-lib:jar:2.4(详情如下图) (2).错误原因:经查看,所需要的jar包已经下载到本地仓库,为何还说缺少jar包?稍微仔细点发现,jar包不一样,需要声明jdk的版本号. (3).解决办法:在版本号下配置jdk15声明jdk版本,如下如: 2.不

maven 加入json-lib.jar 报错 Missing artifact net.sf.json-lib:json-lib:jar:2.4:compile

pom.xml 内容: [html] view plaincopy <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> </dependency> 报错误:Missing artifact net.sf.json-lib:json-lib:jar:2.4: