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

    <div id="blog_text">在eclipse中处理图片,需要引入两个包:<br>
import com.sun.image.codec.jpeg.jpegcodec;import com.sun.image.codec.jpeg.jpegimageencoder;
 <br>报错:<br><span style="color: #ff0000;">access restriction: the type jpegimageencoder is not accessible due to restriction on required library c:\java\jre1.6.0_07\lib\rt.jar</span><br><br><br>此时解决办法:<br><span style="text-indent: 0px; border-collapse: separate; white-space: normal; letter-spacing: normal; color: #000000;"><span style="text-align: left; line-height: 23px; font-size: 14px;">eclipse 默认把这些受访问限制的api设成了error。只要把windows-preferences-java-complicer- errors/warnings里面的deprecated and restricted api中的forbidden references(access rules)选为warning就可以编译通过。</span></span>

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