Access restriction CharacterEncoder 解决方法

Access restriction: The method encode(byte[]) from the type CharacterEncoder is not accessible due to restriction on required library C:\Program Files\Java\jre1.6.0_02\lib\rt.jar

 

调用BASE64Encoder和BASE64Decoder时出现错误

 

解决方法如下

 

eclipse下Window-->Preferences-->Java-->Compiler-->Error/Warnings.
Select Deprecated and Restricted API. Change it to warning.
Change forbidden and Discouraged Reference and change it to warning. (or as your need.)

如下图所示

Access restriction CharacterEncoder 解决方法_第1张图片

 

 

 

ok

 

 

 

 

你可能感兴趣的:(Access restriction CharacterEncoder 解决方法)