The type JPEGCodec is not accessible due torestriction on required library
今天在导入包的时候出现了如下的错误
Access restriction: The type JPEGCodec is not accessible due torestriction on required library
F:\MyEclipse\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\jre\lib\rt.jar
这是由于eclipse的设置问题,它默认把这些受访问限制的API设成了ERROR
这时候只要点击该工程 Windows-Preferences-Java-Complicer-Errors/Warnings
里面的 Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过了。