Error:(13, 60) java: 程序包com.sun.tools.internal.xjc.reader.xmlschema.bindinfo不存在
我在import maven项目时,pom.xml报错Missing artifact com.sun:tools:jar:1.5.0,经过盘查发现是pom引入的struts2相关jar包导致报错。
上网查询说是struts2-core.jar需要依赖Java运行时的tools.jar,解决方案就是将这个jar包手动引入。
解决方案一:
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.7</version>
- <scope>system</scope>
- <systemPath>${JAVA_HOME}\lib\tools.jar</systemPath>
- </dependency>
<version>是你本地jdk版本,必须指定。
如果还报错,就是你的<systemPath>jar包的路径不对,不放心就写绝对地址,比如我的是:C:\Program Files\java\jdk1.7.0_80\lib\tools.jar。
吐嘈下网上关于这个地址的写法有<systemPath>${JAVA_HOME}/../lib/tools.jar</systemPath>,还有<systemPath>${java.home}/../lib/tools.jar</systemPath>拿到我这来都不好使,我个就是我踩的坑,直接写绝对地址就好了。
解决方案二:
将tools.jar拷贝到你的的本地仓库并改名。路径为.m2\repository\com\sun\tools\1.5.0\tools-1.5.0.jar。
同时要新建tools-1.5.0.pom文件,内容如下:
- <?xml version="1.0" encoding="UTF-8"?>
- <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
- </project>
然后在pom.xml中按如下引入:
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
- </dependency>
这种方式,你必须要新建.pom文件才能引入成功的,这个也是我踩的坑。
至于还其他网友说的在eclipse.ini中配置vm参数的,我试了不起作用。以上2种就够用了。
Error:(13, 60) java: 程序包com.sun.tools.internal.xjc.reader.xmlschema.bindinfo不存在的更多相关文章
- Caused by: java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC
Caused by: java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC 缺少com/sun/tools/inte ...
- SpringBoot启动项目时提示:Error:(3, 32) java: 程序包org.springframework.boot不存在
场景 在IDEA中新建SpringBoot项目,后启动项目时提示: Error:(3, 32) java: 程序包org.springframework.boot不存在 实现 将pom.xml中par ...
- Error:(4, 17) java: 程序包org.junit不存在
内容:Error:(4, 17) java: 程序包org.junit不存在 场景:运行测试类的时候,IED新建一个自己的项目,并且不用maven的情况下 解决方案:File -> Projec ...
- java: 程序包com.sun.media.jai.codec不存在
Q:IDEA编译时提示"java: 程序包com.sun.media.jai.codec不存在" A:添加下面的repository到pom.xml中 <repository ...
- 错误: 程序包com.sun.istack.internal不存在
eclipse下maven打包是出现如下错误: [ERROR] D:\code-old\daba_user_mvn\src\main\java\com\dada\transaction\service ...
- Intellij Idea上Spring Boot编译报错:Error:(3, 32) java: 程序包org.springframework.boot不存在
很尴尬,为了使用Spring Boot的Initializr,特意下了个Intellij Idea,刚按提示新建一个Spring Boot的Maven项目后,就出现红叉叉了.因为IDE是新的,开始是M ...
- springBoot 打war包 程序包com.sun.istack.internal不存在的问题
使用的是 idea - Lifecycle-package 的方式打包(maven) 确认 <packaging>war</packaging> 修改启动类: (原启动类) ...
- “程序包com.sun.tools.javac.util不存在” 问题解决
最近工作中在编译打包项目的时候遇到了如标题所示的问题,报这个错误的类是 com.sun.tools.javac.util.Pair.问题很诡异,在Idea可以导入此类,项目启动运行也很正常,但就是在打 ...
- SpringBoot从1.5.1→2.2.4项目加包扫雷一:Error:(8, 44) java: 程序包org.springframework.boot.web.support不存在
更换成新包即可import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
随机推荐
- JSR教程2——Spring MVC数据校验与国际化
SpringMVC数据校验采用JSR-303校验. • Spring4.0拥有自己独立的数据校验框架,同时支持JSR303标准的校验框架. • Spring在进行数据绑定时,可同时调用校验框架完成数据 ...
- ADNI以及study design简介
相关名词: MCI:轻度认知功能障碍 EMCI:早期认知障碍 MCI:轻度认知障碍 LMCI:晚期认知障碍 CN:认知正常的志愿者 DTI:doppler tissue imaging,多普勒组织显像 ...
- java微信公众号JSAPI支付以及所遇到的坑
上周做了个支付宝微信扫码支付,今天总结一下.微信相比支付宝要麻烦许多 由于涉及到代理商,没办法,让我写个详细的申请流程,懵逼啊. 笔记地址 http://note.youdao.com/notesha ...
- Java变量的默认值和初始化
Java变量的默认值和初始化 学习自 <Thinking In Java> 技术小黑屋-为什么局部变量需要显式设置初始化值 变量的默认值 注意只有成员变量才有默认值,而局部变量必须要赋初值 ...
- android listview 优化
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha android convertview作用 ======= 1,convertView复 ...
- Codeforces Round #375 (Div. 2) D. Lakes in Berland 贪心
D. Lakes in Berland 题目连接: http://codeforces.com/contest/723/problem/D Description The map of Berland ...
- 2010-2011 ACM-ICPC, NEERC, Moscow Subregional Contest Problem A. Alien Visit 计算几何
Problem A. Alien Visit 题目连接: http://codeforces.com/gym/100714 Description Witness: "First, I sa ...
- Delphi : Analyze PE file headers?
Analyze PE file headers? { You'll need a OpenDialog to open a Exe-File and a Memo to show the file i ...
- What is OpenOCD?
About OpenOCD was created by Dominic Rath as part of a 2005 diploma thesis written at the University ...
- OpenOCD Debug Adapter Configuration
Correctly installing OpenOCD includes making your operating system give OpenOCD access to debug adap ...