This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Applets and the fly likes AccessControlException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "AccessControlException" Watch "AccessControlException" New topic


sree visu
Ranch Hand

Joined: Jul 05, 2007
Posts: 133

I tried to read the documentation given by sun but it said that we must configure the java.policy file.

Could anyone say where to configure it and where is that available.
Also please do give me an example of how to do it for a particular applet that is handling it

it gives the following exception

please do say me how to add the permission to my local machine the particular java.policy file and where to add it[/CODE]

Thanks for your reply in advance

Regards<br />Sree Visu<br />SCJP 5.0, SCWCD 5.0, SCJD(Preparing B&S 2.2.2)
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42956
The HowCanAnAppletReadFilesOnTheLocalFileSystem page talks about that. It also mentions signing the applet, which is an alternative to changing the security policy.
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 691
Here's a bit of my .java.policy file.There is a Sun program: policytool that provides a GUI to update it. Sometimes it doesn't work, so I often update it with an editor. On my Windows XP, the file is in C:\Documents and Settings

grant codeBase "File:/D:/JavaDevelopment/Testing/-" {
permission "<<ALL FILES>>", "read,write,execute";
permission java.lang.RuntimePermission "";
permission java.lang.RuntimePermission "setFactory";
I agree. Here's the link:
subject: AccessControlException
It's not a secret anymore!