Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Change Read-Only Status of Files in intellij

I have a Java project and I want to modify it in intellij but I can't do it because of this " read-only file " or "file is not writable" , so how I can modify and execute it?

this is the problem

like image 881
Harry Prn Dz Avatar asked May 30 '17 14:05

Harry Prn Dz


People also ask

How do I get out of read only mode in IntelliJ?

With the Clear Read-Only Status option enabled, you make a file writable using file system. When a read-only file is opened in the editor, you double-click lock icon. in the status bar. You remove read-only attribute externally, using file properties.

Why are my files red in IntelliJ?

It means that the files exist locally, but are not in the repository, and are not scheduled for addition. With other words, the files are not under version control. There is not really a problem since the files can just be added to the VCS if desired.

How do you unlock files in IntelliJ?

Unlock a file Select the file you want to unlock, or open it in the editor. Select VCS | Subversion | Unlock from the main menu, or Subversion | Unlock from the context menu of the selection.


2 Answers

To toggle read-only attribute of a file, open file in the editor, or select it in the Project tool window. Do one of the following:

  • On the main menu, choose File | File Properties | Make File Read-Only, or Make File Writable.

enter image description here

  • Click the lock icon in the Status bar in the bottom right corner.

enter image description here

like image 99
Carlos Bernardes Avatar answered Oct 05 '22 23:10

Carlos Bernardes


If IntelliJ IDEA is unable to change the file permissions using File | Make File Writable, then perhaps another user is owning that file, e.g. root (use this command to verify: ls -hal /path/to/File.java)

If someone else owns it, for whatever reason, you can change the permissions yourself using the chown command in the terminal:

sudo chown yourusername /path/to/File.java,

where yourusername is the same user that you used to launch Intellij IDEA.

like image 41
Håvard Geithus Avatar answered Oct 06 '22 00:10

Håvard Geithus