Click here to Skip to main content
15,920,801 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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) Run the applet with
-J-Djava.security.policy=applet.policy
 
Share this answer
 
Comments
TorstenH. 16-Oct-12 14:52pm    
+5 - that's the common way of handling that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900