Link to home
Start Free TrialLog in
Avatar of fifalover
fifalover

asked on

Putting a security policy file inside a JAR file

I need to include a security policy file with my client application because it uses RMI. It won't be edited once deoployed, but I'd like to put it into the JAR file I have all the class files in. This way someone just has to copy over the one JAR file and they can use the application. Is there any way to include a security policy file inside that JAR file? I've tried doing it and then executing the code like so:

java -classpath myjar.jar;. -Djava.security.policy=policy.txt MyClass

It doesn't seem to work. Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fifalover
fifalover

ASKER

If I can't put the policy file into the JAR file, Is there any way to put the stuff from the policy file into the code itself without having to write my own SecurityManager?
no sorry