java使用BASE64Encoder在eclipse中报错
Posted On 2014年3月18日
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
我在java中想使用BASE64Decoder, 但是却报错.
在eclipse里碰到如下的错误
Access restriction: The type BASE64Decoder is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
如何解决呢?
错误是因为eclipse的配置问题。 你可以通过配置,将此错误改为一个warning。 但是最好的是使用apache commons codec 库。
修改eclipse 配置的方法是:
在 eclipse 里 project-> Properties -> Java Compiler -> Errors/Warning -> 有多个列表的菜单,多找一下。 找到 Forbidden Access(access rule) -> 将原来的error 改为 warning/Ignore.
此篇文章已被阅读3280 次