怎么解决BASE64找不到JAR包问题,之前写过一篇,但是只记录了一种方法,本文列举三种解决方法:

最近维护以前的一个项目,发现用到BASE64编码解码的地方出现了错误提示,如下图所示:

Access restriction: The method 'CharacterDecoder.decodeBuffer(String)' is not API...

这是eclipse设置问题,eclipse默认把这些受访问限制的API设成了ERROR,下面列出几种解决方案:

方案一:

右键项目-->Build Path-->Configure  Build  Path-->JRE System Library-->Access rules-->Add,关键步骤截图如下:

Access restriction: The method 'CharacterDecoder.decodeBuffer(String)' is not API...

Access restriction: The method 'CharacterDecoder.decodeBuffer(String)' is not API...

 

Access restriction: The method 'CharacterDecoder.decodeBuffer(String)' is not API...

提示错误信息消失,错误解决:

Access restriction: The method 'CharacterDecoder.decodeBuffer(String)' is not API...

方案二:

Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning

Access restriction: The method 'CharacterDecoder.decodeBuffer(String)' is not API...

方案三:

在build path中先移除JRE System Library,再添加JRE System Library,重新编译后就可以了

Access restriction: The method 'CharacterDecoder.decodeBuffer(String)' is not API...

 

相关文章:

  • 2021-08-09
  • 2021-09-25
  • 2021-05-30
  • 2021-06-16
  • 2021-09-18
  • 2021-08-11
  • 2021-05-20
  • 2021-08-18
猜你喜欢
  • 2021-04-30
  • 2021-07-23
  • 2021-06-24
  • 2021-10-16
  • 2021-06-03
  • 2022-03-01
  • 2021-11-29
相关资源
相似解决方案