eclipse: Access restriction Error

在搭建项目环境时出现了以下编译错误:

Access restriction: The constructor SunJCE() is not accessible due to restriction on required library J:\jdk\jre\lib\ext\sunjce_provider.jar

访问限制:由于J:\jdk\jre\lib\ext\sunjce_provider.jar库的限制,SunJCE() 构造函数不可访问。


Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Access restriction: The constructor SunJCE() is not accessible due to restriction on required library /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/ext/sunjce_provider.jar
Access restriction: The type SunJCE is not accessible due to restriction on required library /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/ext/sunjce_provider.jar

at com.weicai.des.DesUtil.<init>(DesUtil.java:88)
at com.weicai.des.DesUtil.main(DesUtil.java:177)



在网上搜了一下,解决办法是修改编译选项,方法如下:Window -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API -> Forbidden reference (access rules) -> Warnings或者Ignore即可。

你可能感兴趣的:(eclipse)