调用CachedRowSetImpl类时出现错误

调用CachedRowSetImpl类时,出现以下错误:

Access restriction: The type CachedRowSetImpl is not accessible due to restriction on required library C:glassfish3jdk7jrelib t.jar

问题原因:

1.没有rt.jar包,不过这种情况出现的可能性比较小

2.eclipse的设置问题(一般都是这个原因)

问题解决:

(1) 一般方法:要在project build path中先移除JRE System Library,再添加库JRE System Library,之后就可以了。

(2) 暴力方法:它默认把这些受访问限制的API设成了ERROR,我们只要把
Windows->Preferences->Java->Complicer->Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过了

原文地址:https://www.cnblogs.com/xiaofengkang/p/3862787.html