现在的位置: 首页 > 综合 > 正文

Access restriction CharacterEncoder 解决方法

2018年05月11日 ⁄ 综合 ⁄ 共 411字 ⁄ 字号 评论关闭

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.)

如下图所示

 

 

 

ok

 

 

 

 

抱歉!评论已关闭.