原文地址 : 點擊打開鏈接
原文出處:http://blog.csdn.net/darwinchina/article/details/12037999
異常:
- Caused by: java.security.NoSuchAlgorithmException: Cannot find any provider supporting DES
- at javax.crypto.Cipher.getInstance(Cipher.java:524)
問題重現:
在Eclipse中運行下面的代碼。(該異常會在IDE Eclipse運行中出現,但不會在控制檯運行中出現)
- public static void main(String[] args) throws Exception
- {
- Cipher.getInstance("DES");
- }
發生原因:
未知
解決方法:
Window-->Preferences-->Java-->Installed JREs
當前項目使用的JRE設置爲是default JRE
解決方法來源: