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

查看:974
本文介绍了import 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 Files\Java\jre6\lib\rt.jar

如何解决此错误?

推荐答案

该错误是由您的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.

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

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