如果在Eclipse使用某些访问受限的API时,会报这种错误:
[color=red][b]Access restriction: The type Resource is not accessible due to restriction on required library[/b][/color]
这是因为Eclipse默认把这些受访问限制的API设成了ERROR,在java-compiler-Errors/Warnings选项里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过,只是报警告而不是报错,保证了编译能通过。
[color=red][b]Access restriction: The type Resource is not accessible due to restriction on required library[/b][/color]
这是因为Eclipse默认把这些受访问限制的API设成了ERROR,在java-compiler-Errors/Warnings选项里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过,只是报警告而不是报错,保证了编译能通过。