IntelliJ IDEA
IntelliJ IDEA – the Leading Java and Kotlin IDE, by JetBrains
Native file system watcher for Linux
If you’re an IntelliJ user working under Linux you’ve probably seen that boring “Synchronizing files…” spinning icon in a left corner of a status bar. It is there because for an intelligent IDE it is a must to be in the know about any external changes in files it working with – e.g. changes made by VCS, or build tools, or code generators etc. On Windows and Mac OS X native file system watchers used to facilitate this task but on Linux the only option was to recursively scan directory tree. Now you’re welcome to give a try to native file system watcher for Linux.
Prerequisites
File system watcher requires inotify(7) facility. It is in the mainstream kernel for more than two years (since 2.6.13, and in glibc since 2.4) so chances are your distribution don’t miss it. The sign of inotify availability in a system is a presence of /proc/sys/fs/inotify/ directory.
Download and setup
File system watcher binaries (for x86, x64 and ARM) are included in all JetBrains IDEs. Latest builds could be downloaded from our Git repository (place files into bin/ directory of your IDE and grant them execution rights).
Inotify requires a “watch handle” to be set for each directory it monitors. Unfortunately, the default limit of watch handles may not be enough for reasonably sized projects (e.g. IntelliJ IDEA sources contain 30000+ directories). The current limit can be verified by executing:
cat /proc/sys/fs/inotify/max_user_watches
It can be raised by adding following line to the /etc/sysctl.conf file:
fs.inotify.max_user_watches = 524288
… and issuing this command to apply the change:
sudo sysctl -p