ECLIPSE处理错误:Access restriction: The type JPEGImageEncoder is not accessible..
2016-03-10 00:00
323 查看
在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 %JAVA_HOME%\lib\rt.jar
此时解决办法:Eclipse默认把这些受访问限制的API设成了ERROR。
只要把Windows-Preferences-Java-Complicer-Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。
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 %JAVA_HOME%\lib\rt.jar
此时解决办法:Eclipse默认把这些受访问限制的API设成了ERROR。
只要把Windows-Preferences-Java-Complicer-Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。
相关文章推荐
- 在eclipse下的SVN插件配置忽略文件和文件夹
- Java线程:并发协作-生产者消费者模型
- 关于Java文件路径问题
- java获得项目绝对路径
- eclipse 环境下 FreeMarker 编辑器插件
- Java回调函数的理解
- 用JAVA实现堆栈(链表篇)
- Struts2拦截器的使用 (详解)
- java中的日期转换
- java下Class.forName的作用是什么,为什么要使用它
- eclipse启动参数设置大全
- Java从控制台中读取数据完全攻略
- JAVA 中数组的几种排序方法
- java回调
- 用JAVA实现堆栈(数组篇)
- javassist:增强型的java反射工具,获取方法参数名
- 小议 java:comp/env
- Java排序汇总
- java.util.ResourceBundle使用详解
- java获取服务器一些信息的方法