首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 平面设计 > 图形图像 >

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

2012-10-30 
解决办法:Access restriction: The type JPEGImageEncoder is not accessible due to restdiv idblog_t

解决办法: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>

热点排行