Eclipse中Cannot find any provider supporting DES解决之道

原文地址 : 点击打开链接

原文出处:http://blog.****.net/darwinchina/article/details/12037999

异常:

[java] view plain copy
  1. Caused by: java.security.NoSuchAlgorithmException: Cannot find any provider supporting DES  
  2.     at javax.crypto.Cipher.getInstance(Cipher.java:524)  

问题重现:

在Eclipse中运行下面的代码。(该异常会在IDE Eclipse运行中出现,但不会在控制台运行中出现)

[java] view plain copy
  1. public static void main(String[] args) throws Exception  
  2. {  
  3.     Cipher.getInstance("DES");  
  4. }  


发生原因:

未知


解决方法:

Window-->Preferences-->Java-->Installed JREs

当前项目使用的JRE设置为是default JRE

Eclipse中Cannot find any provider supporting DES解决之道

Eclipse中Cannot find any provider supporting DES解决之道


解决方法来源:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=89935