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

無事下載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,即可以編譯通過。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章