转:

解决办法:Access restriction: The type JPEGImageEncoder is not accessible due to restriction

2011年11月27日 20:17:40 IT面试社区 阅读数 29477
 
报错: 
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中处理图片,需要引入两个包:
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
报错:
Access restriction: The type JPEGImageEncoder is not accessible due to
restriction on required library C:\Java\jre1.6.0_07\lib\rt.jar

此时解决办法:
Eclipse
默认把这些受访问限制的API设成了ERROR。只要把Windows-Preferences-Java-Complicer-
Errors/Warnings里面的Deprecated and restricted API中的Forbidden
references(access rules)选为Warning就可以编译通过。

优先选择第一种方法

Access restriction: The type JPEGImageEncoder is not accessible due to restriction的更多相关文章

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

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

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

  3. 解决:高版本jdk编译低版本代码时eclipse提示Access restriction:The type 'Unsafe' is not accessible due to restriction on required library

    在Eclipse中采用高版本jdk编译一些低版本的源码时,由于源码中使用了一些高版本中过时的API,可能就会报错,类似于: Access restriction:The type 'Unsafe' i ...

  4. 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 ...

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

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

  6. Access restriction: The type QName is not accessible due to restriction on required library

    There's another solution that also works. I found it on this forum: Go to the Build Path settings in ...

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

    解决方案:在configure build path 中去掉 jre system library,然后重新加载jre system library.....

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

    方法一: 全局属性Project>preferences>java>Compiler>Errors/Warnings>把右侧的[Deprecated and restri ...

  9. Access restriction: The type Base64 is not accessible due to restriction on

    java build path>把libraries中的JRE System Library删除重新导入.

随机推荐

  1. Image Processing and Analysis_8_Edge Detection:Local Scale Control for Edge Detection and Blur Estimation——1998

    此主要讨论图像处理与分析.虽然计算机视觉部分的有些内容比如特 征提取等也可以归结到图像分析中来,但鉴于它们与计算机视觉的紧密联系,以 及它们的出处,没有把它们纳入到图像处理与分析中来.同样,这里面也有 ...

  2. Django权限和认证模块的解读

    from rest_framework.views import APIView 找到APIView中的dispatch方法 class MyAuth: def authenticate(self): ...

  3. win10激活密钥

    专业版:W269N-WFGWX-YVC9B-4J6C9-T83GX 企业版:NPPR9-FWDCX-D2C8J-H872K-2YT43 家庭版:TX9XD-98N7V-6WMQ6-BX7FG-H8Q9 ...

  4. Lua 学习之基础篇九<Lua 协同程序(Coroutine)>

    引言 讲到协程,首先来介绍一下线程和协程的区别 lua协程和多线程 相同之处:拥有自己独立的桟.局部变量和PC计数器,同时又与其他协程共享全局变量和其他大部分东西 不同之处:一个多线程程序可以同时运行 ...

  5. 自己实现sizeof+大小端测试

    #define my_sizeof(type) ((char *)(&type+1)-(char*)(&type)) 同时大小端测试 如下 #include <stdio.h&g ...

  6. BZOJ 3052/Luogu P4074 [wc2013]糖果公园 (树上带修莫队)

    题面 中文题面,难得解释了 BZOJ传送门 Luogu传送门 分析 树上带修莫队板子题... 开始没给分块大小赋初值T了好一会... CODE #include <bits/stdc++.h&g ...

  7. POJ-1661-Help Jimmy(DP, 递推)

    链接: https://vjudge.net/problem/POJ-1661 题意: "Help Jimmy" 是在下图所示的场景上完成的游戏. 场景中包括多个长度和高度各不相同 ...

  8. django 内置标签

    1.autoescape 自动转义开关 官网:https://docs.djangoproject.com/en/2.2/ref/templates/builtins/ 作用:将 html 内容解析成 ...

  9. django -过滤器的使用

    前情提要: 最近工作中用到django 中的  自定制过滤器的内容, 再此 复习一波过滤器和自定制 过滤器的内容 自定制过滤器   1.在settings中的INSTALLED_APPS配置当前app ...

  10. pyecharts v1 版本 学习笔记 散点图

    散点图 基本案例 from example.commons import Faker from pyecharts import options as opts from pyecharts.char ...