access restriction
一、既然存在访问规则,那么修改访问规则即可。打开项目的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的更多相关文章
- 关于Access restriction: The type 'Application' is not API (restriction on required library)
原文链接:http://rxxluowei.iteye.com/blog/671893 今天写第一次写JavaFX的入门程序就GG 遇到了导入API的问题,无奈疯狂地通过网络找解决方案.. 我的问题是 ...
- Access restriction: The type TaskTopicResolver is not accessible due to restrict
Access restriction: The type TaskTopicResolver is not accessible due to restrict : Eclipse 默认把这些受访问 ...
- Access restriction错误解决办法
Access restriction错误, XX方法 is not accessible due to restriction on required library XXlib 解决方案: Ecli ...
- Access restriction: The type 'BASE64Encoder' is not API
问题的原因好像是这个方法不是安全的,所以不推荐使用,我是在做毕设时要用到的所以就直接用了(毕设要求没有那么严格的要求)
- 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 ...
- 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重新加入. ===== ...
- Eclipse error:Access restriction
报错:Access restriction: The method decodeBuffer(String) from the type CharacterDecoder is not accessi ...
- Access restriction: The type VerticalTextSpinner is not accessible due to restriction on required library........
查了下竟然是编译器报错,orz了. Access restriction: 访问限制 on required library: 在依赖库(第三方包) 那就简单了,取消限制就好, eclipse的Win ...
- Java: How to resolve Access Restriction error
Issue: Access restriction: The constructor 'BASE64Decoder()' is not API (restriction on required lib ...
- Access restriction: The type 'BASE64Encoder'
Access restriction: The type 'BASE64Encoder' is not API (restriction on required library 'D:\Java\jd ...
随机推荐
- python 九九乘法表!小练习
# 1*1 = 1 # 1*2 = 2 2*2 = 4 # 1*3 = 3 2*3 = 6 3*3 = 9 i = 1 j = 1 for j in range(1,10): for i in ran ...
- java编写简单的累加程序
编程思路:1.建立类包demo: 2.在类包中建立CommanParameter类: 3.利用for循环通过强制类型转换将在后台中输入的String类型的字符转换为整型并进进累加操作: package ...
- 我的定时关机程序(MFC实现) .
原理: 利用定时器去检查,如输入的是多少分钟后关机,就根据输入的分钟数产生一个COUNT计数器,计数器一直递减,直到1,然后执行关机.如输入的是几时几分关机,那么定时器会每次都检查系统的时间和你输入的 ...
- MFC创建动态链接库DLL并调用方法详解
实例一: 1.创建一个动态链接库工程,如login_dll. 2.在原工程头文件或者新建头文件如showdlg.h定义动态链接库的导出函数,代码如下: #include "stdafx.h& ...
- js 第一天
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title> ...
- simHash 简介以及java实现
http://gemantic.iteye.com/blog/1701101 simHash 简介以及java实现 博客分类: 算法 simHash java 去重 传统的hash 算法只负责将原始 ...
- strlcpy() 函数
size_t strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t ...
- golang vs java
http://programmers.stackexchange.com/questions/83780/how-fast-can-go-go In terms of language design, ...
- 认识cookie与session的区别与应用
通常我们所说的浏览器自动保存密码,下次不用登陆,网页换皮肤,用户引导,提示一次就不再出现的内容,大部分通过cookie或者session来实现的,在这次制作用户引导中,本人就用到了cookie的内容, ...
- 深入理解typedef
首先请看看下面这两句: typedef int a[10]; typedef void (*p)(void); 如果你能一眼就看出它 ...