解决 eclipse 编译错误:Access restriction: The type Resource is not accessible
eclipse编译报错:
Access restriction: The type Resource is not accessible due to restriction on required library D:\Program Files\Java\jre6\lib\rt.jar
解决方法一:
Project -> Properties -> libraries,
先remove掉JRE System Library,然后再Add Library重新加入。问题解决
解决方法二:
Eclipse 默认把这些受访问限制的API设成了ERROR。
只要把Windows-Preferences-Java-Complicer- Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。方法一彻底解决 方法二治标不治本 不推荐