Java 7 未签名小程序权限 1.7.0_45

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19407975/
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-12 16:54:46  来源:igfitidea点击:

Java 7 unsigned applet permissions 1.7.0_45

javapermissionsappletunsigned

提问by csadler

We have an applet which requires certain permissions, which we sign and grant all permissions.
At development time however we use an unsigned applet.
We set all permissions in the user's .java.policy file in their home directory.

我们有一个需要某些权限的小程序,我们签署并授予所有权限。
然而,在开发时,我们使用未签名的小程序。
我们在用户的主目录中的 .java.policy 文件中设置所有权限。

This has stopped working in 1.7.0_45 (or possibly _40), as the unsigned applet no longer has the extra permissions.
We are seeing an error like this:
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "OurCustomSystemProperty" "read")

这在 1.7.0_45(或可能是 _40)中已停止工作,因为未签名的小程序不再具有额外的权限。
我们看到这样的错误:
引起:java.security.AccessControlException: access denied ("java.util.PropertyPermission" "OurCustomSystemProperty" "read")

CAUSE
Sun have changed the security behaviour of unsigned applets in 1.7.0_45 or 40.
They have now created and set a new deployment property:

原因
Sun 在 1.7.0_45 或 40 中更改了未签名小程序的安全行为。
他们现在已经创建并设置了一个新的部署属性:

deployment.security.use.user.home.java.policy=false

This means the user's .java.policy file is ignored by default.

这意味着默认情况下会忽略用户的 .java.policy 文件。

RESOLUTION
Please see my answer below.

解决方案
请参阅下面我的回答。

回答by csadler

RESOLUTION

解析度

Either:

任何一个:

A. Edit your deployment.properties and set the above property to true
The path for this is of the form: C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
Add a line like this anywhere in the file:

A. 编辑您的 deployment.properties 并将上述属性设置为 true
此路径的格式为:C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
在任何位置添加这样的行文件:

deployment.security.use.user.home.java.policy=true

or

或者

B. Edit your JRE's central java.policy file and grant all permissions to your applet
The path for this is of the form: C:\Program Files (x86)\Java\jre7\lib\security\java.policy

B. 编辑您的 JRE 的中央 java.policy 文件并授予您小程序
的所有权限此路径的格式为:C:\Program Files (x86)\Java\jre7\lib\security\java.policy

HTH!

哼!