Java错误:请安装JCE无限强度管辖权策略文件 [英] Java Error: please install JCE Unlimited Strength Jurisdiction Policy files

查看:194
本文介绍了Java错误:请安装JCE无限强度管辖权策略文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在此Java应用程序上工作,该应用程序需要访问"JCE Unlimited Strength"文件,并且确实安装了它们,并且当我生成jar输出时,在构建解决方案(在Intellij中)时它可以正常工作. ,由于某种原因,它给了我这个烦人的错误:

I am working on this Java application which needs to have access to "JCE Unlimited Strength" files and I DO HAVE installed them and it works properly when I build the solution (in Intellij) BUT when I make a jar output, for some reason it gives me this annoying error:

C:\Users\h\whatever\out\artifacts\Accepter_jar>java -cp Accepter.jar Main
org.apache.poi.EncryptedDocumentException: Export Restrictions in place - please install JCE Unlimited Strength Jurisdic
tion Policy files
        at org.apache.poi.poifs.crypt.CryptoFunctions.getCipher(CryptoFunctions.java:208)
        at org.apache.poi.poifs.crypt.CryptoFunctions.getCipher(CryptoFunctions.java:182)
        at org.apache.poi.poifs.crypt.agile.AgileDecryptor.hashInput(AgileDecryptor.java:269)
        at org.apache.poi.poifs.crypt.agile.AgileDecryptor.verifyPassword(AgileDecryptor.java:116)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:95)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:282)
        at ExcelJob.loadExcelSheet(ExcelJob.java:22)
        at Main.main(Main.java:17)

知道有什么问题吗?

推荐答案

我也遇到过类似的问题,但是使用了Eclipse而不是Intellij. jdk(多个版本)和jre可能是问题.转到您的 C:\ Program Files \ Java 目录,将新下载的JCE jar(取决于Java版本)添加到每个JDK&的 security 文件夹中.您已安装的JRE.

I have gone through similar issue but with eclipse instead Intellij. It could be the problem with the jdk(multiple versions) and jre. Go to your C:\Program Files\Java directory, add the NEWLY DOWNLOADED JCE jars (depending upon the Java version) inside security folder of each of JDK & JRE you have installed.

这篇关于Java错误:请安装JCE无限强度管辖权策略文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆