IntelliJ IDEA
 
2025.1
Get IntelliJ IDEA

Read-only files

Last modified: 07 April 2025

If a file is read-only, it is marked with the closed lock icon the Locked icon in the status bar. If a file is writable, it is marked with the open lock icon the Unlocked icon.

Files can be read-only in certain cases. In these cases, clicking the the Locked icon/the Unlocked icon icon the status bar will not make the file writable.

  • The file is a decompiled class. Complied classes are normally read-only in IntelliJ IDEA.

  • The read-only status is set by a version control system. For example, the file can be locked by Subversion.

    In this case, use IntelliJ IDEA version control integration features to make the file writable.

  • The file size exceeds 2.5 MB. Such files are considered too large for editing.

  • Library files in IntelliJ IDEA are normally read-only by default as the code from them should be used as is. For such files, you will not see the lock icon in the status bar. IntelliJ IDEA applies Reader mode to library files by default.

  • The file does not belong to the project. In this case, the Non-Project Files Protection dialog appears, prompting you to select an action.

  • The file belongs to the generated sources or generated test sources root. Files in these folders are usually read-only as they are generated automatically rather than written manually and can be regenerated. Learn more about different types of folders from Content roots.

  • The file may be marked as read-only in your operating system. To check this status, you can inspect file attributes on Windows or permissions on Unix-based systems like Linux or macOS.