当前位置:首页 > 开发 > 开源软件 > 正文

[转]Access restriction:The type JPEGCodec is not accessible due to restriction on

发表于: 2014-01-05   作者:alleni123   来源:转载   浏览次数:
摘要: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar 解决方法: Project -> Properties -> libraries, 先remove掉JRE
Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar


解决方法:
Project -> Properties -> libraries,
先remove掉JRE System Library,然后再Add Library重新加入。
============================================
在Eclipse中处理图片,需要引入两个包:
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
报错:
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。只要把Windows-Preferences-Java-Complicer- Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。
优先选择第一种方法



转自-> http://blog.csdn.net/free4294/article/details/7017442

[转]Access restriction:The type JPEGCodec is not accessible due to restriction on

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
引用rt.jar中的一个类,结果发生了标题中的错误 "Access restriction: The type XXX is not accessib
引用rt.jar中的一个类,结果发生了标题中的错误 "Access restriction: The type XXX is not accessib
引用rt.jar中的一个类,结果发生了标题中的错误 "Access restriction: The type XXX is not accessib
import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGEncodeParam; i
How to solve This error message can be removed by changing a setting inside Eclipse IDE. Open
- Access restriction: The type IInboundMessageNotification is not accessible due to restricti
Access restriction: The type 'BASE64Encoder' is not API (restriction on required library 'D:\
Access restriction: The constructor BASE64Encoder() is not accessible due to restriction on r
今天在eclipse mars中导入一个外部项目,在编译时出现了下面的错误: Access restriction: The type
Eclipse 为了方便插件开放,控制上游插件对下游插件的可见性,对jar文本进行了分类: Accessible:
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号