PDA

View Full Version : Setting Policy Files for a JAR


icm9768
11-06-2005, 06:11 PM
I'm trying to install a policy file to be used when running a JAR file however I keep getting AccessControlExceptions when the JAR runs. I can run it fine when running the application from the generated class files but the trouble comes when running from the JAR. The policy file is in the top level of the JAR directory structure and is named "security.policy".

My policy file only has one permission and that is:

grant {
permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete, execute";
};

I run the app with this:

java -D.java.security.policy=security.policy gps.jar

I'm thinking that it's some kind of trouble with paths within the JAR but the fact that the File Permission targets <<ALL FILES>> makes me think that shouldn't matter.

Any help would be appreciated