http://dotnet.aspx.cc/file/Eclipse-Access-restriction-Error.aspx
在搭建项目环境时出现了以下编译错误:
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即可。
花下眠工作室:
http://huaxiamian.cc
蜗牛食堂
分享到:
相关推荐
Eclipse默认把这些受访问限制的API设成了ERROR。只要把Windows-Preferences-Java-Complicer-Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过...
当出现"Access restriction: Class is not accessible due to restriction on required library"错误时,这通常是因为Eclipse的访问限制规则。要解决这个问题,可以通过以下步骤将错误级别改为警告: - `Windows -...
但是,有时引入这两个包时会报出错误:`Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library C:/Java/jre1.6.0_07/lib/rt.jar`。 解决方法一:修改全局属性 ...
Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library C:\Java\jre1.6.0_07\lib\rt.jar ``` **解决方案:** 1. **调整Eclipse配置**:Eclipse默认将这些受...
在错误信息中,我们看到 "Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar",这表明你尝试访问的 `JPEGCodec` 类受到了...