如何在不使用 UI 的情况下将站点列表添加到 Java Security?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24241820/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 11:02:08  来源:igfitidea点击:

How to add site list to Java Security without using the UI?

javasecurity

提问by Anonymous

There is an exception list on java security tab like the picture below.java add site list

java 安全选项卡上有一个例外列表,如下图所示。java添加站点列表

I want to add websites to this list using the command line. Is it possible to do that?

我想使用命令行将网站添加到此列表中。有可能这样做吗?

采纳答案by Luke Peterson

The Oracle documentationtells us:

Oracle文档告诉我们:

The location of the exception site list is set in the deployment.user.security.exception.sitesproperty. The default location is <deployment.user.home>/security/exception.sites.

例外站点列表的位置在deployment.user.security.exception.sites属性中设置 。默认位置是<deployment.user.home>/security/exception.sites

So you could add URLs to that file pretty easily on the command line.

因此,您可以在命令行上轻松地向该文件添加 URL。

回答by Boulder

Just checked, on Java 8.111 and Windows 7 Corporate it can be found at

刚刚检查过,在 Java 8.111 和 Windows 7 Corporate 上可以找到它

c:\Users\%username%\AppData\LocalLow\Sun\Java\Deployment\security\exception.sites

c:\Users\%username%\AppData\LocalLow\Sun\Java\Deployment\security\exception.sites

But I suppose that this file (as well as the whole directory chain) is not created by default. So may be you should first add it by hand, then searchfor the exact file location.

但我想这个文件(以及整个目录链)不是默认创建的。因此,您可能应该首先手动添加它,然后搜索确切的文件位置。