I have an Applet which tries to open a file in the client machine. For this to work the jar file (in which the Applet class reside) is signed using the keytool and jarsigner. I have also created a policy file for enabling access to the Applet. The policy reads as below:
The following works fine:
appletviewer -J-Djava.security.policy=mypolicy test.html
Without the '-J-Djava.security.policy=mypolicy' in the above, the Applet would not work!
But if I try to open the html file in a browser (MacOS) then Access is denied.
I think the browser JVM is using the default policy file. One way to make this work is by modifying the JRE policy file. But I dont think my clients would be looking to do that.
My question is... how should I bundle the custom policy file into the jar so that client side there are no changes? Any idea?
NOTE: I have already seen some articles for the same. Would appreciate if anyone provides a very simple working example.
Thanks and Regards,