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 
  
我这样解决的!

时间: 2024-10-24 18:29:19

The constructor BASE64Encoder() is not accessible due to restriction on required的相关文章

Access restriction: The constructor SunJCE() is not accessible due to restriction on required library(转)

错误信息: Access restriction: The constructor SunJCE() is not accessible due to restriction on required library C:\Program Files \Java\jre7\lib\ext\sunjce_provider.jar Access restriction: The type TaskTopicResolver is not accessible due to restrict 做NC的时

Access restriction: The constructor SunJCE() is not accessible due to restriction on required librar

问题现象: Access restriction: The constructor SunJCE() is not accessible due to restriction on required library 原因分析: 大致意识是依赖库 SunJCE() 构造函数被限制访问: 解决思路: 方案一:Window -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restrict

Access restriction : The constructor BASE64Decoder() is not accessible due to restriction on required library

1.问题描述 找不到包  sun.misc.BASE64Encoder 2. 解决方案 只需要在project build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常了.

not accessible due to restriction on required library

The type AWTUtilities is not accessible due to restriction on required library D:\Program Files\jdk1.6.0_24\jre\lib\rt.jar”, Access restriction: The type WindowsLookAndFeel is not accessible due to restriction on required library 解决的方法:在project build

java 错误:Access restriction: The type Resource is not accessible due to restriction on required library

Eclipse 默认把这些受访问限制的API设成了ERROR.只要把Windows-Preferences-Java-Complicer- Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过. java 错误:Access restriction: The type Resource is not accessible due to restrict

Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar 报错

报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar   解决方法: Project -> Properties -> libraries, 先remove掉JRE System Library,然后再Add Library重新加入. 将jre项目用自己下载的jre

The type ProxyGenerator is not accessible due to restriction on required library问题的解决

怎样解决类似的问题: Multiple markers at this line-Access restriction: The type ProxyGenerator is not accessible due to restriction on required library D:\java\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\rt.jar- Access restriction:

报错: The type ByteInputStream is not accessible due to restriction on required library

报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar   解决方法: Project -> Properties -> libraries, 先remove掉JRE System Library,然后再Add Library重新加入.

Access restriction: The type QName is not accessible due to restriction on required library

There's another solution that also works. I found it on this forum: Go to the Build Path settings in the project properties. Remove the JRE System Library Add it back; Select "Add Library" and select the JRE System Library. The default worked fo