【JavaWeb】Access restriction The type is not accessible due to restriction on required library
2015-10-28 09:51
591 查看
MyEclipse无法访问到jar包的解决方法
MyEclipse中编写Java代码时,用到了BASE64Decoderimport sun.misc.BASE64Decoder;
和图片处理相关的
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
可是Eclipse提示:
Access restriction: The type BASE64Decoder is not accessible due to restriction on required library
和Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library
两个异常属于是同一类型,所以可以通过如下的两种解决方法:
方法一:
只需要在project build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常了
方法二:
Eclipse默认把这些受访问限制的API设成了ERROR,所以修改为警告即可:Windows -> Preferences -> Java -> Compiler -> Errors/Warnings ->
Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning
相关文章推荐
- java对世界各个时区(TimeZone)的通用转换处理方法(转载)
- java-注解annotation
- java-模拟tomcat服务器
- java-用HttpURLConnection发送Http请求.
- java-WEB中的监听器Lisener
- Android IPC进程间通讯机制
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 介绍一款信息管理系统的开源框架---jeecg
- 聚类算法之kmeans算法java版本
- java实现 PageRank算法
- PropertyChangeListener简单理解
- 插入排序
- 冒泡排序
- 堆排序
- 快速排序
- 二叉查找树
- [原创]java局域网聊天系统