当前位置:Gxlcms >
数据库问题 >
Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not access
Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not access
时间:2021-07-01 10:21:17
帮助过:4人阅读
准备使用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
![技术分享](http://img.blog.csdn.net/20150821190907038?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
将 Deprecated and restricted API 中的 Forbidden references(access rules) 选为Warning就可以了。
版权声明:本文为博主原创文章,未经博主允许不得转载。
Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not access
标签: