报错: Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library
2017-05-26 14:14
375 查看
报错:
Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
解决方法:
Project -> Properties -> libraries,
先remove掉JRE System Library,然后再Add Library重新加入。
============================================
在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就可以编译通过。
优先选择第一种方法
Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
解决方法:
Project -> Properties -> libraries,
先remove掉JRE System Library,然后再Add Library重新加入。
============================================
在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就可以编译通过。
优先选择第一种方法
相关文章推荐
- The type JPEGImageEncoder is not accessible due to restriction on required library C:\Java\jre1.6.
- Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required libra
- 解决办法:Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required
- Access restriction: The type HttpServlet is not accessible due to restriction on required library xxxx\servlet-api.jar
- The type JPEGImageEncoder is not accessible due to restriction on required library
- Access restriction: The type OutputFormat is not accessible due to restriction on required library D:/Java/jdk1.6.0_20/jre/lib/r
- Access restriction: The type Unsafe is not accessible due to restriction on required library
- (Error) The type AESKeyGenerator is not accessible due to restriction on required library.
- Access restriction: The type XXX is not accessible due to restriction on required library
- Access restriction: The type JPEGCodec is not accessible due to restriction on required library
- Access restriction: The type BMPImageReader is not accessible due to restriction on required library
- access restriction: The type * is not accessible due to restriction on required library
- Access restriction: The type XXX is not accessible due to restriction on required library XXX
- 错误解决:The type [X] is not accessible due to restriction on required library [Y].
- Access restriction: The type XXXX is not accessible due to restriction on required library的解决办法
- Access restriction: The type is not accessible due to restriction on required library问题处理
- 解决Access restriction: The type XXXX is not accessible due to restriction on required library
- Access restriction: The type JFrame is not accessible due to restriction on required library
- java 错误:Access restriction: The type Resource is not accessible due to restriction on required library
- Access restriction: The type XXX is not accessible due to restriction on required library XXX