在用Jenkins部署项目的时候,控制台突然报了如下错误:
cannot find symbol symbol: class BASE64Decoder
location: package sun.misc [INFO] 1 error
BUILD FAILURE
Total time: 16.117 s
解决方案:
java包引入:
import sun.misc.BASE64Decoder;
改成:
import java.util.Base64;
java代码:
BASE64Decoder decoder = new BASE64Decoder();
改成:
Base64.Decoder decoder = Base64.getMimeDecoder();
byte[] bytes = decoder.decode(base64Content);
Base64.Encoder encoder = Base64.getMimeEncoder();
encoder.encode(bytes);
完美解决。