Java 7 未签名小程序权限 1.7.0_45 [英] Java 7 unsigned applet permissions 1.7.0_45

查看:20
本文介绍了Java 7 未签名小程序权限 1.7.0_45的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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")

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

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:

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

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

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

解决方案
请看下面我的回答.

RESOLUTION
Please see my answer below.

推荐答案

RESOLUTION

要么:

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

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:

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

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

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

HTH!

这篇关于Java 7 未签名小程序权限 1.7.0_45的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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