原因
java1.8版本后的jdk已经不再支持sun.misc.BASE64Decoder和sun.misc.BASE64Encoder。
解决
使用 org.apache.commons.codec.binary.Base64 替换:
1 /** 2 * BASE64解码 3 */ 4 public static byte[] decryptBASE64(String key) throws Exception { 5 //return (new BASE64Decoder()).decodeBuffer(key); 6 return Base64.decodeBase64(key); 7 } 8 9 /** 10 * BASE64编码 11 */ 12 public static String encryptBASE64(byte[] key) throws Exception { 13 //return (new BASE64Encoder()).encodeBuffer(key); 14 return Base64.encodeBase64String(key); 15 16 }
标签:BASE64Encoder,return,sun,Base64,misc,key From: https://www.cnblogs.com/muzhongjiang/p/18152753