http://blog.csdn.net/bit2012_2015/article/details/22798779java
————————————————————————————————————————————————————ui
問題緣由:Eclipse 默認把這些受訪問限制的API設成了ERROR.net
解決方法:ssr
1. Windows-> Preferences -> Java -> Compiler -> Errors/Warnings ->Deprecatedand trstricted API -> Forbidden reference (access rules): -> change towarningblog
2. 只須要在projectbuild path中先移除JRESystem Library,再添加庫JRESystem Library,從新編譯後就一切正常了。ip
3. 工程上右鍵->工程屬性->javabuilder path->Libraries標籤,點擊JRE SystemLibrary裏面的Accessrules,addsun/** 爲accessible,若是該項存在,就edit。it
4. Windows-> Preferences -> Java -> Installed JREs -> 選擇用的JDK-> Edit -> Add External JARs編譯