Search code examples
javaintellij-ideaintellij-plugin

How to create file inside the configuration folder of IntelliJ IDEA?


I know that in Ubuntu 14.04 LTS this configuration folder named .IdeaIC14. It could be in any path, depends on installation properties and user's operating system. Is there any way I can get the path to this folder from my intellij plugin to create some files in it?


Solution

  • In an IntelliJ plugin, you can get the path by calling PathManager.getConfigPath().

    In a program that runs outside of IntelliJ IDEA, this is not possible in the general case. On Linux, IntelliJ IDEA determines the actual path to the configuration file by reading bin/idea.properties in the IntelliJ IDEA installation directory, which could be any path (IntelliJ IDEA is installed by unpacking a tar.gz archive, so there is no standard installation location).