I have a problem setting up a policy file for applet. I am doing this for the first time and donβt know how to install the policy file for the applet in java. In fact, I want to give applets permission to write to the file system. for which I will have to grant file permission for the applet
So, I create a file called .java.policy and paste the following code into it
grant codeBase "file:/C://res/applet/*" { permission java.io.FilePermission "C:\\res\\applet\\test.txt", "read, write"; };
and save it in the users \ jindal folder, now I set JAVA_HOME as C: \ Users \ Jindal
but still i found an exception that
java.security.AccessControlException: access denied (java.io.FilePermission C: \ res \ applet \ test.txt write)
can any body please help what is wrong or what should i do
source share