解决方案1:

Eclipse 默认把这些受访问限制的API设成了ERROR。 
Windows -> Preferences -> Java
-> Compiler -> Errors/Warnings
-> 
Deprecated and trstricted API -> Forbidden reference
(access rules): -> change to
warning

解决方案2: 
只需要在project build path中先移除JRE System Library,再添加库JRE System
Library,重新编译后就一切正常了。

解决方案3:

工程上右键->工程属性->java builder
path->Libraries标签,点击JRE System Library里面的Access
rules,add sun/** 为accessible,如果该项存在,就edit。

解决方案4:

Windows -> Preferences -> Java
-> Installed JREs -> 选择用的JDK
-> Edit -> Add External
JARs

Access restriction: The type * is not accessible due to restrict,报错问题的更多相关文章

  1. [转]解决Access restriction: The type * is not accessible due to restrict

    我在eclipse使用org.omg下的东西的时候报此错误 我用的第一种方法解决了问题 转自:http://blog.sina.com.cn/s/blog_6714fba70100x6mz.html ...

  2. Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案

    报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...

  3. 怎么在eclipse中查到这个类用的是哪个jar的类和Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案

    找到了一个办法,你先按F3,然后点击Change Attached Source..按钮,在弹出的框里有个路径,我的路径是D:/SNFWorkSpace/JAR/~importu9.jar,然后你去引 ...

  4. Access restriction: The type TaskTopicResolver is not accessible due to restrict

    Access restriction: The type TaskTopicResolver is not accessible due to restrict :  Eclipse 默认把这些受访问 ...

  5. 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重新加入. ===== ...

  6. Access restriction: The type BASE64Encoder is not accessible due to restrict(转载)

    Access restriction: The type BASE64Encoder is not accessible due to restrict 2011年11月18日 20:47:06 阅读 ...

  7. java加密用到了BASE64Decoder时报错信息:Access restriction: The type BASE64Encoder is not accessible due to restrict

    在Eclipse中编写Java代码时,用到了BASE64Decoder,import sun.misc.BASE64Decoder;可是Eclipse提示: Access restriction : ...

  8. 解决:高版本jdk编译低版本代码时eclipse提示Access restriction:The type 'Unsafe' is not accessible due to restriction on required library

    在Eclipse中采用高版本jdk编译一些低版本的源码时,由于源码中使用了一些高版本中过时的API,可能就会报错,类似于: Access restriction:The type 'Unsafe' i ...

  9. 报错: Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library

    报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...

随机推荐

  1. poj 1182 并查集高级应用

    C - 是谁站在食物链的顶端 Crawling in process... Crawling failed Time Limit:1000MS     Memory Limit:10000KB     ...

  2. (搬运工)推荐!国外程序员整理的 C++ 资源大全

    标准库 C++标准库,包括了STL容器,算法和函数等. C++ Standard Library:是一系列类和函数的集合,使用核心语言编写,也是C++ISO自身标准的一部分. Standard Tem ...

  3. uva 10167 - Birthday Cake

    题解:由于解太多,随机抓 A.B, 只要有符合就行了: (首先,Ax+By=0必须表示直线,即A.B不能同时为0:另外,要注意到直线不能过输入中的2N个点:检测点在直线的哪一侧,只需要简单的线性规划的 ...

  4. ubuntu -server 忘记root 密码方法

    允许 su 到 root 非常简单,只需要重新设置下密码即可.下面是设置的方法: 1 me@ubuntu:~$ sudo passwd 2 密码:<--- 输入安装时那个用户的密码3 输入新的 ...

  5. Android用gif做启动页

    公司的一个app的启动页想改为gif图,之前没有在android中加入过gif,所以赶紧饿补! 前言 我们都知道ImageView是不能完美加载Gif格式的图片,如果我们在ImageView中src指 ...

  6. NGINX当中的SSL配置(PEM启动密码免输入)

    干过的都懂,这个东东好像很碍事. 很影响RELOAD的效率...并且,,,好像这个弄了之后,NGINX作RELOAD之后,可以即时更新配置了..(还是说那个DVROOT.CER影响的??未考证) ht ...

  7. UNIX网络编程--ioctl操作(十七)

    一.概述 在本书中有两个地方都对这个函数进行了介绍,其实还有很多地方需要这个函数.ioclt函数传统上一直作为纳西而不适合归入其他精细定义类别的特性的系统接口.网络程序(特别是服务器程序)经常在程序启 ...

  8. jQuery手机触屏左右滑动切换焦点图特效代码

    原文地址:http://www.17sucai.com/pins/4857.html 演示地址:http://www.17sucai.com/pins/demoshow/4857 干净演示地址:htt ...

  9. maven compile时出现“非法字符: \65279”的解决

    我碰到的这个问题是因为Java文件编码为UTF-8 BOM格式导致:解决这个可以使用UltraEdit. 用UltraEdit打开出问题的Java文件,将文件另存为,在保存对话框的编码中选择UTF-8 ...

  10. C++ int 转换成 string intToString

    string intToString(int num) { stringstream ss; ss<<num; return ss.str(); } 一个简单的小例子. #include ...