升级jdk版本之后会发现,原来使用的一些加密方法开始报错了。

解决方法如下,删除原方法中引入的包,将原方法中的


 BASE64Encoder encoder = new BASE64Encoder();

String imagestr =  encoder.encode(captcha);

BASE64Decoder decoder = new BASE64Decoder();

byte[] bytes = decoder.decodeBuffer(imagestr); 


替换成如下方法即可


 import java.util.Base64.Encoder;

byte[] result = decoder.decode(str);


原因是/lib/tool.jar和/lib/rt.jar已经从Java SE 9中删除。

原文链接:https://blog.csdn.net/Cha0DD/article/details/87794268

相关文章:

  • 2022-01-02
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-05
  • 2021-06-01
  • 2021-12-22
  • 2021-04-23
  • 2021-08-26
相关资源
相似解决方案