转:

解决办法: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. 02.python网络爬虫第二弹(http和https协议)

    一.HTTP协议 1.官方概念: HTTP协议是 Hyper Text Transfer Protocol(超文本传输协议)的缩写,是用于从万维网(www.world wide web) 服务器传输超 ...

  2. 1.Hbase集群安装配置(一主三从)

     1.HBase安装配置,使用独立zookeeper,shell测试 安装步骤:首先在Master(shizhan2)上安装:前提必须保证hadoop集群和zookeeper集群是可用的 1.上传:用 ...

  3. 13_sqoop数据迁移概述

    3. sqoop数据迁移 3.1 概述 sqoop是apache旗下一款“Hadoop体系和关系数据库服务器之间传送数据”的工具. 导入数据:MySQL,Oracle导入数据到Hadoop的HDFS. ...

  4. No package libmcrypt available.

    Centos安装PHP时,安装php依赖包时yum install libmcrypt libmcrypt-devel,报错如下: No package libmcrypt available. No ...

  5. MySQL-进阶7-子查询 - select后/where后/from后/ []where后/having后] / exists后面 的相关子查询

    /*SQL-进阶7-子查询 含义:出现在其他语句中的select 语句,称为子查询或内查询 外部的查询语句,称为主查询 或者 外查询 分类1:按子查询出现的位置———— select 后面:仅仅支持标 ...

  6. MYSQL参数说明

    [mysqld] character_set_server=utf8 #慢日志时间 long_query_time=1 #开启慢日志 slow_query_log=TRUE #慢日志位置 slow_q ...

  7. python ini文件内容的读取

    (1)新建一个项目,再次新建一个文件 test_cfg.ini (2)再次新建 get_test_cfg.py,用来读取/写入/更改 ini的文件内容 #!/usr/bin/env python # ...

  8. v-model原理解析

    vue中v-model可以实现数据的双向绑定,但是为什么这个指令就可以实现数据的双向绑定呢? 其实v-model是vue的一个语法糖.即利用v-model绑定数据后,既绑定了数据,又添加了一个inpu ...

  9. Springboot AOP写操作日志 GET POST

    pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId> ...

  10. 018_查看有多少远程的 IP 在连接本机(不管是通过 ssh 还是 web 还是 ftp 都统计)

    #!/bin/bash#使用 netstat -atn 可以查看本机所有连接的状态,-a 查看所有,-t 仅显示 tcp 连接的信息,-n 数字格式显示# Local Address(第四列是本机的 ...