Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
网友说:Eclipse 默认把这些受访问限制的API设成了ERROR。只要把Windows-Preferences-Java-Complicer- Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。
这是治标不治本的欺骗自己的方法。
正解如下:
Project -> Properties -> libraries,
先 remove 掉 JRE System Library,然后再 Add Library 重新加入。