java.security.AccessControlExc ... [英] java.security.AccessControlExc...

查看:478
本文介绍了java.security.AccessControlExc ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你们好,

我需要您的帮助,我正在尝试使用run = Runtime.getRuntime(),pp = run.exec("c:\ program files \ ... \ *.exe"从applet执行本地系统中的程序).

但是我从JVM中得到一个例外,原因是

"java.security.AccessControlException:访问被拒绝(java.io.FilePermission C:\ Programexecute)"

我已将Java策略文件修改为

权限java.io.FilePermission"C:/Program Files/GX/Scanner/Abby Testing.exe",执行";
权限java.io.FilePermission"*","execute";

它真正紧急的维护项目被阻止了.

如果有人可以帮助我进行排序,这将非常有帮助.

Hai guys,

I need your help,I am trying to execute a program which is in the local system from an applet using run = Runtime.getRuntime(), pp=run.exec("c:\program files\...\*.exe) .

But i am getting an exception from the JVM as

"java.security.AccessControlException: access denied (java.io.FilePermission C:\Programexecute)"

I had modified the java policy file as

permission java.io.FilePermission "C:/Program Files/GX/Scanner/Abby Testing.exe" ,"execute";
permission java.io.FilePermission "*" ,"execute";

Its really urgent ma enitre project is blocked.

It will be very very helpful, if some one can help me to sort this.

推荐答案

您可以覆盖SecurityManager使用的默认安全策略文件: br/>
1)创建一个文本文件(例如applet.policy)

2)通过将小程序添加到文件中,将所有权限授予小程序:
You can override the default security policy file used by the SecurityManager:

1) Create a text file (eg. applet.policy)

2) Grant all permissions to the applet by adding this to the file:
grant {
 permission java.security.AllPermission;
};



3)使用
运行小程序



3) Run the applet with

-J-Djava.security.policy=applet.policy


这篇关于java.security.AccessControlExc ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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