jce异常

Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism
at javax.crypto.JceSecurity.(JceSecurity.java:93)
... 33 more
Caused by: java.lang.SecurityException: Cannot locate policy or framework files!
at javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:316)
at javax.crypto.JceSecurity.access$000(JceSecurity.java:50)
at javax.crypto.JceSecurity$1.run(JceSecurity.java:85)
at java.security.AccessController.doPrivileged(Native Method)
at javax.crypto.JceSecurity.(JceSecurity.java:82)

这是由于jce包不对,去oracle官方下载一个对应版本的jce包替换掉即可。

java8的在http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
解压后有三个文件:

README.txt                  
local_policy.jar             
US_export_policy.jar  

看README.txt就了解怎么用了,我是将<JAVA_HOME> /jre/lib/security/policy/unlimited里的两个文件替换 。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值