执行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);