【解决方案】报错:cannot find symbol [ERROR] symbol: class BASE64Decoder

执行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.Decoder decoder = Base64.getMimeDecoder();
byte[] base64DValue = decoder.decode(URLValue);

猜你喜欢

转载自www.cnblogs.com/miaoying/p/12299069.html