Try this and tell me if it works. It worked for me when opening the hosts file.
http://www.labnol.org/software/edit-hosts-files-as-administrator/13673/
edit:
Relevant information from the linked page:
Step 1. Open the Windows Start menu, find the Notepad application and right-click the Notepad icon.
Step 2. Select "Run as administrator", and then, inside the notebook, go to the folder (java.home \ lib \ security \ java.security).
Now you can edit and save this file in one folder without any problems. Recall that the trick is that instead of directly opening the protected file in the corresponding application, you start the application first as an administrator, and then open the file inside it.
source share