`
palwang
  • 浏览: 51642 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

The constructor BASE64Encoder() is not accessible due to restriction on required

阅读更多
在Eclipse中编写Java代码时,用到了BASE64Decoder,import sun.misc.BASE64Decoder;可是Eclipse提示:
Access restriction : The type BASE64Decoder is not accessible due to restriction on required library C:\Program
files\java\jre6\lib\rt.jar
Access restriction : The constructor BASE64Decoder() is not accessible due to restriction on required library C:\Program files\java\jre6\lib\rt.jar
搞不懂是为什么,最后在http://forums.dzone.com/eclipse/384-access-restriction-problems.html找到答案,只需要在project build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常了。但是我仍然很疑惑是为什么。。。
原文见:http://zhoushuyan.cn/java/the-type-base64decoder-is-not-accessible-due-to-restriction-on-required-library/

------------------------------

Windows -> Preferences -> Java -> Compiler -> Errors/Warnings ->
Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning
 
我这样解决的!

分享到:
评论
3 楼 haolyj98 2012-06-05  
我今天也碰到这问题了,虽然问题解决了,但是还是没找到问题发生的原因
2 楼 beanopen 2011-09-16  
mark一下,我是在更改Project Facets(项目编译级别)后出现这个问题的
1 楼 thiink 2011-08-27  
有哪位高手知道具体的原因啊?期待中

相关推荐

Global site tag (gtag.js) - Google Analytics