I want to execute a jar file using the policy file from my project. my policy file:
*grant codeBase "file:///D:/xx/yy/zz/-"{ permission java.io.FilePermission "D:/aa/bb/test.jar", "read, write, delete, execute"; };*
my project is under the folder D: / xx / yy / zz /, and I want to run test.jar in this project, but I had an error:
access denied (java.io.FilePermission <> execute)
if I modify the policy file like this, this is normal:
*grant codeBase "file:///D:/xx/yy/zz/-"{ permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete, execute"; };*
But I do not want to give all permissions to my project.
And also in the project, I install the policy file as follows:
String path = "D: \ aa \ bb \ test.jar";
System.setProperty("java.security.policy","C:\\policy\\"+"test.policy"); System.setSecurityManager(new SecurityManager());
Is there any body to say something about this situation? Thanks...
source share