Search code examples
javapermissionsnetbeans-8

Can't modify my java source file in Netbeans. Source file display in grey window


I was writing the code in Netbeans and everything was fine. But Suddenly My computer shutdown. After i open my java source file in Netbeans it doesnot let me edit. The window is gray. For the better clarification i have attached the screenshot below.

Screenshot here


Solution

  • This happened because somebody (somehow) changed your file permissions to read-only. You can change the permission to full control.

    If you are on Windows : icacls <yourFile> /grant %username%:(r,w,x)

    if you are in Linux : chmod a+rwx <yourFile>

    or you can recursively do the whole project directory using below command

    If you are on Windows : icacls * /grant %username%:(OI)(CI)(r,w,x) /T

    Explanation: F = Full Control CI = Container Inherit - This flag indicates that subordinate containers will inherit this ACE. OI = Object Inherit - This flag indicates that subordinate files will inherit the ACE. /T = Apply recursively to existing files and sub-folders. (OI and CI only apply to new files and sub-folders).

    If you are on Linux : chmod a+rwx * -R

    //R is recursive**