在plugin开发时,有时遇到ACCESS RESTRICTION错误: Access restriction: Class is not accessible due to restriction on required library。。。,网络上一般解决方案是:
preference--->java--->complier--->errors/warning
---->deprecated and restricted API
把 Forbidden reference 的Error改成warning 即可
此法虽然可消除错误,但属于掩耳盗铃,对后续的开发会有影响。还有一种方案是:
firt,delete the JRE System Libriaries. Then,import JRE System Libriaries again. I don't konw why.However i fixed my problom,hope it can help you
此法也可解决问题。但并没有指出问题根源。
方案三(我们的方案):邮件-properties-Order and Export选项卡-将jre Library移到Plugin Dependencies包之上,问题解决。
原因是当前插件包与引用插件包冲突,方法二是放弃了所依赖插件的包,而方案三保持了与所依赖插件的一致。
转载于:https://blog.51cto.com/ooinrcp/414075