一、既然存在访问规则,那么修改访问规则即可。打开项目的Build Path Configuration页面,打开报错的JAR包,选中Access rules条目,选择右侧的编辑按钮,添加一个访问规则即可。

二、网上的另外一种解决方案:Window - preference - Java - Compiler - Errors/Warnings界面的Deprecated and restricted API下。把Forbidden reference (access rules): 的规则由默认的Error改为Warning。

如我碰到的是不能访问o.e.j.http.ssl.SslContextFactory, 但是它是继承了jetty-util里的类,而jetty-util的access-rule没有导出这个包,添加:
org/eclipse/jetty/util/ssl/*

后来有看了下,原来的SslContextFactory用的是7.5.1的jetty-http里来的,升级到8.1.16后,它已被弃用,而manifest.xml里的import packages里还是导入的jetty-http-ssl而不是jetty-util-ssl,access rule就是根据这个来的,所以把代码改成使用jetty-util中的类而不是已经弃用的jetty-http中的类,修复import packages就好了.

access restriction的更多相关文章

  1. 关于Access restriction: The type 'Application' is not API (restriction on required library)

    原文链接:http://rxxluowei.iteye.com/blog/671893 今天写第一次写JavaFX的入门程序就GG 遇到了导入API的问题,无奈疯狂地通过网络找解决方案.. 我的问题是 ...

  2. Access restriction: The type TaskTopicResolver is not accessible due to restrict

    Access restriction: The type TaskTopicResolver is not accessible due to restrict :  Eclipse 默认把这些受访问 ...

  3. Access restriction错误解决办法

    Access restriction错误, XX方法 is not accessible due to restriction on required library XXlib 解决方案: Ecli ...

  4. Access restriction: The type 'BASE64Encoder' is not API

    问题的原因好像是这个方法不是安全的,所以不推荐使用,我是在做毕设时要用到的所以就直接用了(毕设要求没有那么严格的要求)

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

    报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...

  6. 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重新加入. ===== ...

  7. Eclipse error:Access restriction

    报错:Access restriction: The method decodeBuffer(String) from the type CharacterDecoder is not accessi ...

  8. Access restriction: The type VerticalTextSpinner is not accessible due to restriction on required library........

    查了下竟然是编译器报错,orz了. Access restriction: 访问限制 on required library: 在依赖库(第三方包) 那就简单了,取消限制就好, eclipse的Win ...

  9. Java: How to resolve Access Restriction error

    Issue: Access restriction: The constructor 'BASE64Decoder()' is not API (restriction on required lib ...

  10. Access restriction: The type 'BASE64Encoder'

    Access restriction: The type 'BASE64Encoder' is not API (restriction on required library 'D:\Java\jd ...

随机推荐

  1. ==、equals、hashCode区别?

    [==.equals().hashCode()区别?] 1)== 运算符用来比较两个变量的值是否相等. 即该运算符用于比较变量对应得内存中所存储的数值是否相同,要比较两个基本类型的数据或两个引用变量是 ...

  2. The Accomodation of Students(判断二分图以及求二分图最大匹配)

    The Accomodation of Students Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d &a ...

  3. VI/VIM 常用命令

    VI/VIM 常用命令=========== 整理自鸟哥的私房菜 ---------- - 移动光标 命令                    | 描述----------------------- ...

  4. classpath获取--getResource()

    在java中的API里,有两种方式来使用classpath读取资源. 1. Class的getResource() 2. ClassLoader的getResource() 但是两者有一定区别,运行以 ...

  5. python 常用

    1. dir()             不带参数时,返回当前范围内的变量.方法和定义的类型列表:带参数时,返回参数的属性.方法列表.如果参数包含方法__dir__(),该方法将被调用.如果参数不包含 ...

  6. /etc/fstab 文件解释

    /etc/fstab 文件解释 文件fstab包含了你的电脑上的存储设备及其文件系统的信息.它是决定一个硬盘(分区)被怎样使用或者说整合到整个系统中的唯一文件. 这个文件的全路径是/etc/fstab ...

  7. SharePoint 2010 应用url参数过滤列表视图数据(应用get办法过滤列表数据)

    名人名言:读活书,活读书,读书活.——郭沫若 题目其实不知道如何称呼才干合适大师的搜刮习惯.以便有类似题目经由过程百度或google可以搜刮到,其实就是在url后面添加参数过滤显示我们想要的成果,有人 ...

  8. Git 多人协作开发

    当你从远程仓库克隆时,实际上Git自动把本地的master分支和远程的master分支对应起来了,并且你的远程仓库的默认名称是origin 查看远程库的信息,用git remote LV@LV-PC ...

  9. A - 娜娜梦游仙境系列——诡异的钢琴

    A - 娜娜梦游仙境系列——诡异的钢琴 Time Limit: 2000/1000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Othe ...

  10. weka简介

    1.weka的历史 1992年末,新西兰怀卡托大学计算机科学系Ian Written博士申请基金. 1993年获新西兰政府资助,并于同年开发出接口和基础架构. 1994年发布了第一个weka的内部版本 ...