1. 程式人生 > >使用sun.misc.BASE64Decoder出錯解決方案

使用sun.misc.BASE64Decoder出錯解決方案

方法1 : 

import=”sun.misc.BASE64Decoder” 
出現錯誤提示為:Access restriction: The type BASE64Decoder is not accessible due to restriction 
on required library D:\ProgramFiles\MyEclipse\jre\lib\rt.jar 
Solution 1 : 
BASE64Decoder 
這個沒有java doc,屬於jdk裡不推薦使用的工具類 
解決方案: 
使用apache common中的Base64替換 
你可以在這裡下載Apache commons codec: 
http://commons.apache.org/codec/ 
替換一下就可以了 
強烈建議不要用sun.misc,是不安全的 ,最好不要使用 

方法2:

1. Open project properties. 
2. Select Java Build Path node. 
3. Select Libraries tab. 
4. Remove JRE System Library. 
5. Add Library JRE System Library.