[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/jenkins/agent/workspace/pipeline_p-cgs8h-1/src/main/java/com/xx/sea/base/util/EncryptionCoder.java:[9,16] cannot find symbol
symbol: class BASE64Decoder
location: package sun.misc
[ERROR] /home/jenkins/agent/workspace/pipeline_p-cgs8h-1/src/main/java/com/xx/sea/base/util/EncryptionCoder.java:[10,16] cannot find symbol
symbol: class BASE64Encoder
location: package sun.misc
[INFO] 2 errors
修改为
util.Base64
import java.util.Base64;
/** * BASE64解密 * * @param key * @return * @throws Exception */ public static byte[] decryptBASE64(String key) throws Exception { Base64.Decoder decoder=Base64.getMimeDecoder(); return decoder.decode(key); } /** * BASE64加密 * * @param key * @return * @throws Exception */ public static String encryptBASE64(byte[] key) throws Exception { Base64.Encoder encoder=Base64.getMimeEncoder(); return encoder.encodeToString(key); }