导入import com.sun.image.codec.jpeg.JPEGCodec出错

时间:2017-08-24 23:12:32   收藏:0   阅读:273

在Eclipse中处理图片时,需要引入两个包:
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;

报错,编译不通过解决办法:
Eclipse默认把这些受访问限制的API设成了ERROR。只要把Windows-Preferences-Java-Complicer-Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。

原文:http://www.cnblogs.com/HackerXieHao/p/7425526.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!