读书人

eclipse开发工具 -Access restriction

发布时间: 2013-08-10 21:14:06 作者: rapoo

eclipse开发工具 -Access restriction 编译错误

Access restriction: The type Unsafe is not accessible due to restriction on required library D:\dev\Java\jdk1.6.0_31\jre\lib? \rt.jar

?

问题原因:Eclipse 默认把这些受访问限制的API设成了ERROR。

解决办法:将 Windows->Preferences->Java-Complicer->Errors/Warnings->Deprecated and restricted API,中的Forbidden references(access rules)设置为Warning,即可以编译通过。

读书人网 >Access

热点推荐