Question:
Access restriction: the type * is not accessible due to restriction on required library *.jar
Access restriction:The method * is not accessible due to restriction on required library *.jar
Description:
Eclipse环境下,项目中导入某些JAR,使用这些JAR中的某些API。结果出现Access restriction错误,如下图:
Accuse:
Access restriction的原因是因为这些JAR默认包含了一系列的代码访问规则(Access Rules),如果代码中引用了这些访问规则所禁止引用类,那么就会提示这个错误信息。
Action:
一、既然存在访问规则,那么修改访问规则即可。打开项目的Build Path Configuration页面,打开报错的JAR包,选中Access rules条目,选择右侧的编辑按钮,添加一个访问规则即可。
二、网上的另外一种解决方案:Window - preference - Java - Compiler - Errors/Warnings界面的Deprecated and restricted API下。把Forbidden reference (access rules): 的规则由默认的Error改为Warning。
这种方案是修改整个Eclipse开发环境,将所有禁止访问的引用由原来的Error(默认)修改为Warning。这种规避方式比较粗暴,个人支持第一种方案。
来源地址:http://hi.baidu.com/oritenson/blog/item/9b6c072a90a1dce199250a8e.html
分享到:
相关推荐
sun.misc.BASE64Encoder找不到jar包的解决方法?... Access restriction : The constructor BASE64Decoder() is not accessible due to restriction on required library C:\Program files\java\jre6\lib\rt.jar
Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library C:\Java\jre1.6.0_07\lib\rt.jar 此时解决办法: Eclipse默认把这些受访问限制的API设成了ERROR。只要把...
在Eclipse中处理图片,需要引入两个包: ...Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library C:\Java\jre1.6.0_07\lib\rt.jar 解决方法就在这里
Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library C:\Java\jre1.6.0_07\lib\rt.jar 此时解决办法: Eclipse默认把这些受访问限制的API设成了ERROR。只要...
App Restriction是一款可以定期清理后台应用,释放内存,节省电池电量的系统清理优化神器。 现在的流氓应用越来越多,动不动就常驻后台,杀还杀不掉,消耗内存,消耗电池。 这个工具专杀流氓应用,并且定期清理它们...
欧洲铁路局车辆使用限制条件编码
the restriction theorem
顶级pdf文件处理工具,可以有效消除pdf文档的诸多应用(例如:打印、复制粘贴等)限制。 原创优质资源,互联网独此一份,非常值得珍藏。只要下载,绝对不会后悔。
Restriction of Java in Real-Time Embedded
电路模型和电路定律_NoRestriction习题[整理].pdf
电子-MSP430系列常用模块应用原理NoRestriction.pdf,单片机/嵌入式MSP430
思科产品速手册(2010年3月版)_NoRestriction,好资料不等人啊
Only TMSConnectDialog component requires Forms unit.Trial version restrictions--------------------------Note following restriction when using SDAC trial version.When SDAC based application is running...
A20-USB-Camera开发说明书-V1.0-20140605_NoRestriction.pdf
机器学习基石 6 - 1 - Restriction of Break Point (14-18).mp4
EDM安全存取有二种的控管方式:debug access indICation和EDM access restriction.种控管方式(debug access indication)提供了一个sideband signal用于指示从调试器(Debug host)的请求。第二种控管方式, 控制...
EDM安全存取有二种的控管方式:debug access indication和EDM access restriction.第一种控管方式(debug access indication)提供了一个sideband signal用于指示从调试器(Debug host)的请求。第二种控管方式, ...
JavaScript
MT6325_PMIC_Data_Sheet_V01_password_6493012377_NoRestriction.pdf