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

原文:

http://blog.csdn.net/free4294/article/details/7017442


我碰到的是:

Access restriction: The type CalendarUtils 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重新加入。

Eclipse 默认把这些受访问限制的API设成了ERROR。
只要把Windows-Preferences-Java-Complicer- Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。


先记录,以后搞清楚原因再加

你可能感兴趣的:(Access restriction: The type XXX is not accessible due to restriction on required library)