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,即可以编译通过。