How to get the JAR file for sun.misc.BASE64Encoder class?(如何获取 sun.misc.BASE64Encoder 类的 JAR 文件?)
问题描述
我的 Activity 类中有一些代码使用 sun.misc.BASE64Encoder 类.但它显示 java.lang.NoClassDefFoundError : sun.misc.BASE64Encoder.我需要 jar 吗?从哪里下载?
I have some code in my Activity class that uses sun.misc.BASE64Encoder class. But it is showing java.lang.NoClassDefFoundError : sun.misc.BASE64Encoder. Do I need the jar? Where can I download it from?
推荐答案
不要使用 sun.* 类.对于 Android 中的 Base64,请使用它的 本机类 或将库添加到您的执行此操作的项目(Apache commons 等).或者,如果您需要在 2.2 之前的设备上使用它,只需将 Android 源代码复制到您的项目(在您自己的包中).
Don't use sun.* classes. For Base64 in Android, use it's native class or add a library to your project that does this (Apache commons, etc.). Alternatively just copy the Android source code to your project (in your own package), if you need to use it on pre-2.2 devices.
这篇关于如何获取 sun.misc.BASE64Encoder 类的 JAR 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何获取 sun.misc.BASE64Encoder 类的 JAR 文件?
基础教程推荐
- RabbitMQ:消息保持“未确认"; 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
