Spring tool suite编译不通过:Access restriction: The type XXX is not accessible
来源:互联网 发布:淘宝客服培训ppt 编辑:程序博客网 时间:2024/05/16 06:20
一、发现问题
通过jaxb操作xml,引入javax.xml.bind相关包时,spring tool suite编译不通过。
二、分析原因
Spring tool suite就是eclipse上套了一层spring的插件,本质还是eclipse。Eclipse默认把某些受访问限制的API设成了ERROR。,所以会编译不通过。
三、解决问题
方法1:
把对某些限制API的级别设置为warning
Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning。
方法2:
在project build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常。
方法3:
工程上右键->工程属性->ja。va builder path->Libraries标签,点击JRE System Library里面的Access rules,add sun/** 为accessible,如果该项存在,就edit。
方法4:
Windows -> Preferences -> Java -> Installed JREs -> 选择用的JDK -> Edit -> Add External JARs。
四、总结
我实验了前两种方法,可以实现。还有一些方法是参照网上的,请大家自己试一试。
参考地址:http://blog.sina.com.cn/s/blog_6714fba70100x6mz.html
- Spring tool suite编译不通过:Access restriction: The type XXX is not accessible
- Access restriction: The method XXX from the type XXX is not accessible due to restriction XXX
- Access restriction: The type xxx is not accessible due to restriction on restriction on required l
- Access restriction: The type XXX is not accessible due to restriction on required library XXX
- Access restriction: The type XXX is not accessible due to restriction on required library XXX
- Access restriction: The type XXX is not accessible due to restriction on required library XXX
- Access restriction: The type XXX is not accessible due to restriction on required library
- Access restriction: The type XXX is not accessible due to restriction on required lib
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方法
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
- Access restriction: The type FtpClient is not accessible due to
- Access restriction: The type * is not accessible due to restrict
- sdcare文件的操作
- 用ServletContext读取资源文件的三种方式
- 静态分析工具及使用总结(二)CheckStyle
- 采用AT88SC系列芯片进行系统加密的原理
- C++虚函数解析
- Spring tool suite编译不通过:Access restriction: The type XXX is not accessible
- Android系统架构工具
- 静态分析工具及使用总结(三)
- WORD2003相关问题
- 玩转Google开源C++单元测试框架Google Test系列(gtest)(总)
- at88sc系列加密芯片的工作原理
- 从K近邻算法、距离度量谈到KD树、SIFT+BBF算法
- 趣文:编程语言伪简史
- python 操作windows下的目录[转]