解决办法:Access restriction: The type JPEGImageEncoder is not accessible due to rest

在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


此时解决办法:
eclipse 默认把这些受访问限制的api设成了error。只要把windows-preferences-java-complicer- errors/warnings里面的deprecated and restricted api中的forbidden references(access rules)选为warning就可以编译通过。

你可能感兴趣的:(java,java,工作)