当前位置: 代码迷 >> Eclipse >> eclipse支持sun.包的配备
  详细解决方案

eclipse支持sun.包的配备

热度:59   发布时间:2016-04-23 02:21:30.0
eclipse支持sun.*包的配置
    在项目中使用BASE64Decoder,eclipse的编辑器莫名报错,

Multiple markers at this line
- Access restriction: The type BASE64Decoder is not accessible due to restriction on
required library C:\Program Files\Java\jre6\lib\rt.jar
- Access restriction: The method decodeBuffer(String) from the type CharacterDecoder is
not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
- Access restriction: The constructor BASE64Decoder() is not accessible due to
restriction on required library C:\Program Files\Java\jre6\lib\rt.jar

可见eclipse对rt.jar中的sun.*没有权限可以访问,在项目上右键点击Properties-Java Build Path,选择右侧的Libraries标签,展开JRE System Library,选中Access rules,点击Edit,Add一条rule,其中Resolution选择Accessible,Rule Pattern填入sun/**,保存后错误即消失。
  相关解决方案