贴出错误提示代码【节选】:
Access restriction: The method encode(byte[]) from the type CharacterEncoder,Access restriction: The type FileURLConnection is xxx
纠错结果:
这个是eclipse设置问题,它默认把这些受访问限制的API设成了ERROR,只要把Windows-Preferences-Java-Complicer-Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过了。
分析:
像这样的异常信息,是eclipse设置问题,问题:Access restriction: The type FileURLConnection is not accessible due to restriction on required library C:/Program Files/Java/jre6/lib/rt.jar 或者servlet-api.jar