博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用JPEGImageEncoder提示Access restriction:错误 解决方案
阅读量:7261 次
发布时间:2019-06-29

本文共 1039 字,大约阅读时间需要 3 分钟。

hot3.png

使用JPEGImageEncoder提示Access restriction:错误

当我们在对图片进行操作时,需要使用到

JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam jep = JPEGCodec.getDefaultJPEGEncodeParam(tag);
这个时候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 JPEGCodec is not accessible due to restriction on required library C:\Java\jre1.6.0_07\lib\rt.jar
Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not accessible due to restriction on required library C:\Java\jre1.6.0_07\lib\rt.jar
Access restriction: The method encode(BufferedImage) from 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就可以编译通过了。

转载于:https://my.oschina.net/bv10000/blog/635306

你可能感兴趣的文章
Morris图表使用小记
查看>>
GoldenGate实时投递数据到大数据平台(3)- Apache Flume
查看>>
Linux - 配置php-fpm 以及 配置nginx支持php
查看>>
基于FPGA的线阵CCD实时图像采集系统
查看>>
php--------对象(object) 与 数组(array) 的转换
查看>>
linux下生成core dump文件方法及设置【转】
查看>>
java基础面试题
查看>>
Windows系统下MySQL添加到系统服务方法(mysql解压版)
查看>>
maven install 打包 报错 Cannot run program "gpg.exe": CreateProcess error
查看>>
[转]Greenplum 执行计划之广播与重分布
查看>>
工作日志:dispatch_once、网络缓存、分享问题
查看>>
centos7下安装nginx(转)
查看>>
SQL Server 动态行转列(参数化表名、分组列、行转列字段、字段值)
查看>>
【转】提交http请求之python与curl
查看>>
spring3: AOP 之 通知参数
查看>>
Xshell 一款很养眼的配色方案推荐
查看>>
翻译:赋值操作符(:=)(已提交到MariaDB官方手册)
查看>>
laravel中的注册页面
查看>>
MySQL 5.7并发复制和mysqldump相互阻塞引起的复制延迟
查看>>
JVM 类加载机制详解
查看>>