Access restriction 问题解决

最近导入新项目,导入所有用到的jar包,发现其中一个引用报错

import com.sun.istack.internal.Nullable;

具体信息如下:

Access restriction: The type Nullable is not accessible due to restriction on required library C:\Program Files\Java\jdk1.7.0_09\jre\lib\rt.jar

确定对应jar包存在

解决方法:

1、选中报错项目,右键,选择properties

2、选择java build path, Libraries中的JRE System Libarary[...]下的Access rules,点击Edit

3、选择Add,Resolution选择Accessible,Rule pattern输入**,OK 保存

稍等会,就搞定了!

时间: 2024-08-26 04:50:43

Access restriction 问题解决的相关文章

错误Access Restriction: The Type BASE64Encoder 的解决

在Eclipse中,出现"Access Restriction: The Type BASE64Encoder Is Not Accessible Due To Restriction"错误. 解决方法: 点击Window-->Preferences-->Java-->Compiler-->Errors/Warns,设置Deprecated And Restricted API 参数值. 问题解决. 错误Access Restriction: The Type

Access restriction: The type TaskTopicResolver is not accessible due to restrict--编译Hadoop时有个SecurityUtils有错误,处理方法

Access restriction: The type TaskTopicResolver is not accessible due to restrict 做NC的时候从别人那拷了个NC_DEMO结果我这报错他那没报错 import nc.bs.wfengine.engine.ext.TaskTopicResolver; 报错信息:Access restriction: The type TaskTopicResolver is not accessible due to restrict

java 错误:Access restriction: The type Resource is not accessible due to restriction on required library

Eclipse 默认把这些受访问限制的API设成了ERROR.只要把Windows-Preferences-Java-Complicer- Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过. java 错误:Access restriction: The type Resource is not accessible due to restrict

Access restriction: The type 'BASE64Encoder' is not API

问题的原因好像是这个方法不是安全的,所以不推荐使用,我是在做毕设时要用到的所以就直接用了(毕设要求没有那么严格的要求) Access restriction: The type 'BASE64Encoder' is not API (restriction on required library '/home/rocky/develop/jdk1.8.0_65/jre/lib/rt.jar') Access restriction: The type 'BASE64Encoder' is not

2015/5/7 Access restriction: The type 'BASE64Encoder' is not API

Access restriction: The type 'BASE64Encoder' is not API (restriction on required library 'D:\Java\jdk1.6.0_43\jre\lib\rt.jar') 引入import sun.misc.BASE64Encoder; 是红叉,怎么解决? 右键项目,点属性(Properties): java bulid path-->Libraries-->jre System Library: Access

Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not access

准备使用Java进行图片压缩的时候,使用 import com.sun.image.codec.jpeg.*; 结果出现错误: Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not accessible due to restriction on required library 上网查了一下,发现是IDE的设置问题,它默认把这些受访问限制的API设成了ERROR

Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案

原文链接:http://rxxluowei.iteye.com/blog/671893. Eclipse 编译时报错:         Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:/Program Files/Java/jre6/lib/rt.jar         解决方法:         Project -> Properties -> l

MyEclipse 中Access restriction 出现问题的解决

在MyEclipse平台下进行JSP编程的时候,常常会出现Access restriction的错误. 这是因为这些JAR默认包含了一系列的代码访问规则(Access Rules),如果代码中引用了这些访问规则所禁止引用类,那么就会提示这个错误信息. 解决方法: 右击项目,选择属性,Java Build Path ,Libraries,点击JRE System Library ,Jre System Library下有个Access rules,双击打开,这里默认访问规则,上面下拉框改为acce

Access restriction: SSLSocket is not accessible due to restriction issue

Access restriction: The method setSSLParameters(SSLParameters) from the type SSLSocket is not accessible due to restriction on required library C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar Menu-projects-java build path-libraries-chose JRE (列表最下面)