無事下載Google的common包guarva玩玩,丟到eclipse中就編譯報錯:Access restriction: The type Unsafe is not accessible due to restriction on required library C:\Java\jre6\lib\rt.jar
問題原因:Eclipse 默認把這些受訪問限制的API設成了ERROR。
解決辦法:將Windows->Preferences->Java-Complicer->Errors/Warnings->Deprecated and restricted API,中的Forbidden references(access rules)設置爲Warning,即可以編譯通過。