执行mvn clean install -DskipTests对项目进行编译时,报错如下:

[ERROR] /Users/miaoying/Documents/.../utils/ThreeDESUtil.java:[4,16] cannot find symbol
[ERROR]   symbol:   class BASE64Decoder
[ERROR]   location: package sun.misc
[ERROR] /Users/miaoying/Documents/.../utils/ThreeDESUtil.java:[5,16] cannot find symbol
[ERROR]   symbol:   class BASE64Encoder
[ERROR]   location: package sun.misc

解决方案:

去掉 BASE64Encoder, BASE64Decoder 相关 import,改为如下:

BASE64Encoder base64en = new BASE64Encoder();
requestValue = base64en.encode(src);
// 改为
Base64.Encoder encoder = Base64.getMimeEncoder();
requestValue = encoder.encodeToString(src);

Base64.Decoder decoder = Base64.getMimeDecoder();
byte[] base64DValue = decoder.decode(URLValue);

 

相关文章:

  • 2022-02-12
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-28
  • 2022-02-18
  • 2021-04-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-12-25
相关资源
相似解决方案