Access restriction: The type XXX is not accessi...



- Access restriction: The type IInboundMessageNotification is not accessible due to restriction on required library C:\Program Files\Java\jdk\jre\lib\ext
  \jdsmsserver-3.4.jar


google了一下 下面是解决方法:

Eclipse 默认把这些受访问限制的API设成了ERROR。只要把Windows-Preferences-Java-Complicer- Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。

 

不过这个不好,如果你的jre目录里面有你项目需要引用的jar包 ,而你又引用了外部jar包,也就是说引用了两次,

如果你想让起作用的是手动引用的外部jar包 这个时候需要把 "Referenced Library" 调整到 "JRE System Library"上面



引用的顺序是从上到下

改变顺序前的效果:

Access restriction: The type XXX is not accessi...

build path

Access restriction: The type XXX is not accessi...

最后效果

Access restriction: The type XXX is not accessi...

OK   一切正常...

转载于:https://my.oschina.net/hokkaido/blog/85803