随笔 - 6, 文章 - 1, 评论 - 13, 引用 - 0
数据加载中……

Access restriction: The type BASE64Encoder is not accessible due to restrict

在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

转自:
http://palwang.iteye.com/blog/906425

posted on 2011-10-26 22:29 风清扬 阅读(29227) 评论(11)  编辑  收藏 所属分类: J2SE

评论

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

果然是这样啊!!顶一个!!
2014-09-05 10:26 | 下一行code

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

问题解决,谢谢。顶一个
2014-10-29 09:36 | mini

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict[未登录]  回复  更多评论   

a623397674: niubi 厉害
2014-12-06 11:52 | jie

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

问题搞定谢谢
2014-12-20 10:52 | exp

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

真的好用了。。。牛逼
2015-04-22 11:19 | 爪哇网

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

有效
2015-07-23 21:07 | Pom

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

66666
2015-12-02 14:13 | 谢琮

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

真的谢谢。原因会否与jar的加载顺序有关?
2016-01-20 11:22 | 独者

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

谢谢
2016-02-26 13:06 | 阿凡达

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

Access restriction: The type BASE64Decoder is not accessible due to restriction on required library C:\Program Files\Java\jdk1.6.0_24\jre\lib\rt.jar
2016-03-24 16:04 | 11

# re: Access restriction: The type BASE64Encoder is not accessible due to restrict  回复  更多评论   

有效果
2016-06-01 15:57 | 行走的风

只有注册用户登录后才能发表评论。


网站导航:
博客园   IT新闻   Chat2DB   C++博客   博问