[转]解决Access restriction: The type * is not accessible due to restrict

我在eclipse使用org.omg下的东西的时候报此错误

我用的第一种方法解决了问题

转自:http://blog.sina.com.cn/s/blog_6714fba70100x6mz.html

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 restriction on required library NC_DEMO/NC_HOME/modules/uap/META-INF/lib/uapplatform.jar

解决方案1:

Eclipse 默认把这些受访问限制的API设成了ERROR。 
Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> 
Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning

解决方案2: 
只需要在project build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常了。

解决方案3:

工程上右键->工程属性->java builder path->Libraries标签,点击JRE System Library里面的Access rules,add sun/** 为accessible,如果该项存在,就edit。

解决方案4:

Windows -> Preferences -> Java -> Installed JREs -> 选择用的JDK -> Edit -> Add External JARs

俺试了下1,4可行。。。我只是我的,具体每个的差别没研究,谁有研究 给个消息

时间: 2024-10-13 22:01:34

[转]解决Access restriction: The type * is not accessible due to restrict的相关文章

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

错误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

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 type 'Application' is not API (restriction on required library)

原文链接:http://rxxluowei.iteye.com/blog/671893 今天写第一次写JavaFX的入门程序就GG 遇到了导入API的问题,无奈疯狂地通过网络找解决方案.. 我的问题是: 导入import javafx.application.Application;时 出现这个错误提示 Access restriction: The type 'Application' is not API (restriction on required library 'C:\Progra

Java,AWTUtilities,eclipse报编译错误:Access restriction: The type 'AWTUtilities' is not API (restriction on required library 'C:\Program Files\Java\jre7\lib\rt.jar')

[场景]调用com.sun.awt.AWTUtilities时,eclipse提示编译错误: Access restriction: The type 'AWTUtilities' is not API (restriction on required library 'C:\Program Files\Java\jre7\lib\rt.jar') [分析]eclipse项目默认的jre版本较早. com.sun.awt.AWTUtilities是在JDK 6 update10中增加的. [解决

Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar 报错

报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar   解决方法: Project -> Properties -> libraries, 先remove掉JRE System Library,然后再Add Library重新加入. 将jre项目用自己下载的jre

Access restriction: The type 'BASE64Encoder'

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

Access restriction: The type 'Resource' is not API (restriction on required library 'G:\JAVA\jdk\lib

问题: 打入JFrame时候,会报错:Access restriction: The type 'Resource' is not API (restriction on required library 'G:\JAVA\jdk\lib 解决方式: 项目属性preferences>java build path>把右侧[libraries中的JRE System Library]删除重新导入. Access restriction: The type 'Resource' is not AP

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