Java security policy file question

12,075

Solution 1

Make sure you run the editor you use to edit the file (e.g. notepad) as Administrator -- otherwise the file permissions set on that directory will not allow you to modify the file. Right click on notepad, select "Run as administrator" then load the file in notepad, edit it and save it and that should work.

Solution 2

One more option that worked for me was,

  1. Copied the original file java.security to my desktop.
  2. Changed the desktop version using notepad++ or any editor
  3. Saved it.
  4. And copied back this updated version to original file replacing the entire file.
  5. Opened the file to confirm the changes
  6. Deleted the desktop version.
Share:
12,075
Mike
Author by

Mike

Updated on June 13, 2022

Comments

  • Mike
    Mike almost 2 years

    Okay guys, I am trying to get the interpreter to use my .policy file for some JAAS stuff I am doing. When I try to enter the extra entry (ie. policy.url.3=file:/C:/Test/raypolicy ) in my Windows:java.home\lib\security\java.security file, it refuses to save the new entry. I get a Save not successuful prompt telling me to make sure that the program is not open in somewhere else. Of course, it is not open somewhere else.

    I know that it is a wrong setting somewhere on my computer as I am able to save to my java security file on my computer at work. I am running a Windows 7 on my personal computer and a windows xp at work. I have also already checked the file settings for the security file and I am set up as the administrator so I have authority to change the file, etc. Any and all thoughts are welcome.

  • Mike
    Mike about 13 years
    That sounds like it should do the trick. . . I can't use my laptop for another hour when I take my next break. . . but I will let you know what happens. Thanks Liv!!!
  • Mike
    Mike almost 13 years
    Sorry about that Liv! I thought I accepted that answer on May 16. . . my apologies. Thanks again for your help:)