導入項目到eclipse時編譯報錯: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 默認把這些受訪問限制的API設成了ERROR。
只要把Windows-Preferences-Java-Complicer- Errors/Warnings裏面的Deprecated and restricted API中的Forbidden references(access rules)選爲Warning就可以編譯通過。
方法一徹底解決 方法二治標不治本 不推薦