Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not access

准备使用Java进行图片压缩的时候,使用

import com.sun.image.codec.jpeg.*;  

结果出现错误:

Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not accessible due to restriction on required library

上网查了一下,发现是IDE的设置问题,它默认把这些受访问限制的API设成了ERROR

解决方法:

Windows->Preferences->Java->Complicer->Errors/Warnings

将 Deprecated and restricted API 中的 Forbidden references(access rules) 选为Warning就可以了。

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-10-20 00:48:09

Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not access的相关文章

Access restriction: The method 'CharacterEncoder.encode(byte[])' is not API...

问题描述:Access restriction: The method 'CharacterEncoder.encode(byte[])' is not API... 解决方法:这种错误是eclipse设置问题,修改eclipse的设置即可:点击Windows --> Preferences --> Java --> Complicer --> Errors/Warnings --> Deprecated and restricted API中的Forbidden refer

Access restriction: SSLSocket is not accessible due to restriction issue

Access restriction: The method setSSLParameters(SSLParameters) from the type SSLSocket is not accessible due to restriction on required library C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar Menu-projects-java build path-libraries-chose JRE (列表最下面)

Eclipse error:Access restriction

报错:Access restriction: The method decodeBuffer(String) from the type CharacterDecoder is not accessible due to restriction on required library Access restriction: The constructor BASE64Decoder() is not accessible due to restriction on required librar

Access restriction: The type TaskTopicResolver is not accessible due to restrict--编译Hadoop时有个SecurityUtils有错误,处理方法

Access restriction: The type TaskTopicResolver is not accessible due to restrict 做NC的时候从别人那拷了个NC_DEMO结果我这报错他那没报错 import nc.bs.wfengine.engine.ext.TaskTopicResolver; 报错信息:Access restriction: The type TaskTopicResolver is not accessible due to restrict

java 错误:Access restriction: The type Resource is not accessible due to restriction on required library

Eclipse 默认把这些受访问限制的API设成了ERROR.只要把Windows-Preferences-Java-Complicer- Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过. java 错误:Access restriction: The type Resource is not accessible due to restrict

Access restriction: The type 'BASE64Encoder' is not API

问题的原因好像是这个方法不是安全的,所以不推荐使用,我是在做毕设时要用到的所以就直接用了(毕设要求没有那么严格的要求) Access restriction: The type 'BASE64Encoder' is not API (restriction on required library '/home/rocky/develop/jdk1.8.0_65/jre/lib/rt.jar') Access restriction: The type 'BASE64Encoder' is not

2015/5/7 Access restriction: The type 'BASE64Encoder' is not API

Access restriction: The type 'BASE64Encoder' is not API (restriction on required library 'D:\Java\jdk1.6.0_43\jre\lib\rt.jar') 引入import sun.misc.BASE64Encoder; 是红叉,怎么解决? 右键项目,点属性(Properties): java bulid path-->Libraries-->jre System Library: Access

Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案

原文链接:http://rxxluowei.iteye.com/blog/671893. Eclipse 编译时报错:         Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:/Program Files/Java/jre6/lib/rt.jar         解决方法:         Project -> Properties -> l

MyEclipse 中Access restriction 出现问题的解决

在MyEclipse平台下进行JSP编程的时候,常常会出现Access restriction的错误. 这是因为这些JAR默认包含了一系列的代码访问规则(Access Rules),如果代码中引用了这些访问规则所禁止引用类,那么就会提示这个错误信息. 解决方法: 右击项目,选择属性,Java Build Path ,Libraries,点击JRE System Library ,Jre System Library下有个Access rules,双击打开,这里默认访问规则,上面下拉框改为acce