是访问限制报错.
在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】删除重新导入.