"Access restriction: The type BASE64Encoder is not accessible due to restrict"问题解决

问题如题:

Eclipse中有一种叫做存取限制的机制,来防止你错误使用那些非共享的API。通常来说,Eclipse做的是对的,因为两点,我们不想要使用非共享API的,而且Eclipse知道什么是共享的和非共享的API。但是有时我们想要使用非共享的API,比如说用gmail的来发送和接收邮件,要用到SSL。这个就是非共享的API。这时候我们就要更改一些设置了。

有以下两种解决方法:

方法一:

全局属性Project>preferences>java>Compiler>Errors/Warnings>把右侧的【Deprecated and restricted API>Forbidden reference的Error】置为【Warning】.或着【Ignore】.

方法二:

项目属性preferences>java build path>把右侧【libraries中的JRE System Library】删除重新导入.

推荐使用后一种方法。

参考文章:

Access restriction: The type 'Application' is not API (restriction on required library rt.jar)

百度知道:https://zhidao.baidu.com/question/506978967.html

原文地址:https://www.cnblogs.com/Anidot/p/7753281.html