zoukankan      html  css  js  c++  java
  • BASE64Encoder及BASE64Decoder的正确用法

    一直以来Base64的加密解密都是使用sun.misc包下的BASE64EncoderBASE64Decodersun.misc.BASE64Encoder/BASE64Decoder类。这人个类是sun公司的内部方法,并没有在java api中公开过,不属于JDK标准库范畴,但在JDK中包含了该类,可以直接使用。但是在eclipseMyEclipse中直接使用,却找不到该类。

    在MyEclipse中编写Java代码时,用到了BASE64Decoder,import sun.misc.BASE64Decoder;可是Eclipse提示: 
    Access restriction : The type BASE64Decoder is not accessible due to restriction on required library C:Program 
    filesjavajre6lib
    t.jar 
    Access restriction : The constructor BASE64Decoder() is not accessible due to restriction on required library C:Program filesjavajre6lib
    t.jar 
    
    解决方案1(推荐): 
    只需要在project build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常了。 
    解决方案2: 
    Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> 
    Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning 

     

    成长的乐趣,在于分享!
    大龄程序员,一路走来,感慨颇多。闲暇时写写字,希望能给同行人一点帮助。
    本文版权归作者growithus和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    Top的VIRT是什么
    python的日志logging模块性能以及多进程
    Python的多进程锁的使用
    extjs动态导入
    初识Dubbo 系列之5-Dubbo 成熟度
    POJ 2151 Check the difficulty of problems(概率dp)
    自考
    疯狂Java学习笔记(70)-----------挚爱Java
    2014年辛星解读css第三节
    atitit。流程图的设计与制作 attilax 总结
  • 原文地址:https://www.cnblogs.com/growithus/p/11012258.html
Copyright © 2011-2022 走看看