4

I am trying to edit the java.security file in windows. When I add an entry to it and try to save, it says 'Access Denied'. How do I change the permissions to this file. I have also tried by making notepad to Run as administrator but it didn't work. Please help.

2 Answers 2

11

Try this and say if it works. It worked for me while opening hosts file.

http://www.labnol.org/software/edit-hosts-files-as-administrator/13673/

edit:

The relevant information from the linked page:

Step 1. Open your Windows start menu, search for the notepad application and then right click the notepad icon.

Step 2. Choose “Run as administrator” and then, while inside notepad, browse to folder (java.home\lib\security\java.security).

You can now edit and save that file in the same folder without any issues. To recap, the trick is that instead of directly opening a protected file in the associated application, you run the application first as an administrator and then open the file inside it.

Sign up to request clarification or add additional context in comments.

1 Comment

@user2014850 Consider accepting the answer as this might help others :)
0

1) Copy original java.security file to desktop. 2) Edit the file there and save it. 3) Copy the file to %JAVA_HOME%/\jre\lib\security 4) Replace the original file with modified one.

3 Comments

Are you sure you can overwrite a file which needs admin permissions without doing anything to escalate your own permissions?
I am assuming typical %JAVA_HOME% = "C:\Program Files\Java\jdk1.x.x". When you try to overwrite the file in that folder it will prompt you to escalate the permission. You can then click "YES" and proceed. If you do not have admin rights then you should ask for it in order to do it.
Also, the answer I have provided is helpful in case the file is in use by some unknown process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.