解决Eclipse Access restriction: 问题

调试一个JAVA程序,Eclipse下报错:
The method encode(byte[]) from the type CharacterEncoder is not accessible due to restriction on required library C:\Program Files\Java\jdk1.6.0_21\jre\lib\rt.jar

解决方案:在Window -preferences - Java - Compiler - Errors/Warnings界面的Deprecated and restricted API下。把Forbidden reference (access rules): 的规则由默认的Error改为Warning即可。

你可能感兴趣的:(eclipse)