![](/img/trans.png)
[英]java.security.NoSuchAlgorithmException:Cannot find any provider supporting AES/ECB/PKCS7PADDING
[英]java.security.NoSuchAlgorithmException: Cannot find any provider supporting Blowfish/ECB/PKCS5Padding
我已通過卸載較舊的jdk和安裝較新的jdk從jdk1.8.0_121
(以及jre)升級到jdk1.8.0_131
,並且加密代碼停止工作。
源代碼: http : //docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec.html#BlowKeyEx
日食錯誤:
Exception in thread "main" java.security.NoSuchAlgorithmException: Blowfish KeyGenerator not available
at javax.crypto.KeyGenerator.<init>(KeyGenerator.java:169)
at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:223)
at com.encrypt_app.BlowfishKey.main(BlowfishKey.java:12)
如果在沒有IDE的情況下運行,則不會出現任何錯誤。
我采取的步驟:
轉到Windows > Preferences > Installed JREs
,並將目錄更改為C:\\Program Files\\Java\\jdk1.8.0_131
。 確保項目的構建路徑設置。
嘗試重新啟動Eclipse,清理並刷新項目。
將JAVA_HOME更新為C:\\Program Files\\Java\\jdk1.8.0_131
-在沒有IDE的情況下運行相同的代碼,並且可以正常工作。
-clean
參數啟動eclipse(編輯eclipse.ini) 從構建路徑中刪除庫,然后使用更新的JRE重新添加。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.