是访问限制报错.
在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
方法一:全局属性preferences>java>Compiler>Errors/Warnings>把右侧的【Deprecated and restricted API>Forbidden reference的Error】置为【Warning】
方法二(终极方法:) 项目属性preferences>java build path>把右侧【libraries中的JRE System Library】删除重新导入.
最后
以上就是拉长春天最近收集整理的关于Eclipse import com.sun.image.codec.jpeg.JPEGCodec 错误处理办法的全部内容,更多相关Eclipse内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复