File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 42965
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: 692
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!