导入 sun.misc.BASE64Encoder 导致在 Eclipse 中编译出错 [英] import sun.misc.BASE64Encoder results in error compiled in Eclipse

查看:32
本文介绍了导入 sun.misc.BASE64Encoder 导致在 Eclipse 中编译出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于这两个导入;

import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;

我收到此错误:

Access restriction: The type BASE64Decoder is not accessible due to restriction on required library C:Program FilesJavajre6lib
t.jar

我该如何解决这个错误?

How can I resolve this error?

推荐答案

该错误是由您的 Eclipse 配置引起的.您可以将其减少为警告.更好,使用非 Base64 编码器非公共 API 的一部分.Apache Commons 有 一个,或者当您已经使用 Java 1.8 时,请使用 java.util.Base64.

That error is caused by your Eclipse configuration. You can reduce it to a warning. Better still, use a Base64 encoder that isn't part of a non-public API. Apache Commons has one, or when you're already on Java 1.8, then use java.util.Base64.

这篇关于导入 sun.misc.BASE64Encoder 导致在 Eclipse 中编译出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆