Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java security policy file question

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.

like image 514
Mike Avatar asked Dec 08 '25 12:12

Mike


2 Answers

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.

like image 178
Liv Avatar answered Dec 10 '25 02:12

Liv


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.
like image 21
Shrikant Havale Avatar answered Dec 10 '25 02:12

Shrikant Havale



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!