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 文件?


- Java包名称中单词分隔符的约定是什么? 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01