Access restriction: The type 'BASE64Encoder' is not API (restriction on required library 'D:\Java\jdk1.6.0_43\jre\lib\rt.jar')
eclipse引入import sun.misc.BASE64Encoder; 是红叉,怎么解决?
工具/原料
方法/步骤
-
右键项目,点属性(Properties);
![Access restriction: The type 'BASE64Encoder'](http://c.hiphotos.baidu.com/exp/w=500/sign=56678ca0a6cc7cd9fa2d34d909002104/8cb1cb1349540923279cf4339758d109b2de4982.jpg)
-
java bulid path-->Libraries-->jre System Library;
![Access restriction: The type 'BASE64Encoder'](http://b.hiphotos.baidu.com/exp/w=500/sign=08f4ee756b061d957d4637384bf50a5d/bf096b63f6246b60adc62539eef81a4c500fa2b7.jpg)
-
Access Rules-->Edit;
![Access restriction: The type 'BASE64Encoder'](http://e.hiphotos.baidu.com/exp/w=500/sign=9bfd8a451a30e924cfa49c317c096e66/0df3d7ca7bcb0a466eea1c746e63f6246a60afb7.jpg)
-
Add,resolution选择accessible,下面填上** 点击确定即可!
![Access restriction: The type 'BASE64Encoder'](http://b.hiphotos.baidu.com/exp/w=500/sign=cb2c50ae522c11dfded1bf2353266255/500fd9f9d72a60598cd876572d34349b023bbab7.jpg)
-
5
这时项目就不再报错了;
![Access restriction: The type 'BASE64Encoder'](http://f.hiphotos.baidu.com/exp/w=500/sign=824a4a59bd99a9013b355b362d940a58/7acb0a46f21fbe09f61955596e600c338744ad3c.jpg)