Access restriction: The type 'BASE64Encoder' is not API 的解决方法
轉(zhuǎn)自:?https://www.mkyong.com/java/access-restriction-the-type-base64encoder-is-not-accessible-due-to-restriction/
If you insist want to use?sun.misc.BASE64Encoder, in Eclipse, right click on the project, properties -> Java compiler –> Errors/Warnings –> Deprecated and restricted API –> Forbidden reference (access rules), change the default “Error” to “Warning“. Now, your code should be able to compile, but with some warning messages.?
The above solution is not recommended, you should replace?sun.misc.BASE64Encoder?with other BASE64 class like?Apache common codec. that is?http://commons.apache.org/proper/commons-codec/?
import org.apache.commons.codec.binary.Base64;//...result = new Base64().encodeToString(rawHmac); 創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的Access restriction: The type 'BASE64Encoder' is not API 的解决方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 消息称泰坦号潜艇遇难事件将改编为电影
- 下一篇: 怎么查苹果手机序列号