IntelliJ-IDEA: Where are settings files saved for v11.x on Windows 7? - intellij-idea

When I load/save settings on my PC for IntelliJ-IDEA v11+ Ultimate on Windows 7, it is super slow (seconds). I think the settings are being saved on a network drive (corporate setup), but I want to confirm.
What is the default location on Windows 7 for IntelliJ-IDEA settings files?
How can I change the location of settings files?
UPDATE
I checked my idea.properties file here: C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.1.5\bin\idea.properties. I see this entry (commented-out):
# idea.config.path=${user.home}/.IntelliJIdea/config
My insane corporate setup has Java's user.home mapped to \\UBSPROD.MSAD.UBS.NET\UserData\arpeke\RF. There, I found the folder named .IntelliJIdea with my settings.

IntelliJ saves its config and indexes, which can amount to several gigs worth of data, to your home directory. It's been that way for approximately "a long time". In my experience, if you have default network mounts, your home dir will be set to one of those, so that's very likely your problem. Edit <idea dir>/bin/idea.properties to change the location where it saves stuff. There will be a handful of properties to change because it calls things out individually rather than having one, overall directory.

Props to Ryan for the hint I needed. Posting a detailed answer here, because I could not find the answer anywhere else on the Net.
Discover your Java's user.home System property settings.
See this Q&A: On Windows 7, how does Java JVM set "user.home" System property?
Or, try in an Java IDE: System.out.println(System.getProperty("user.home"));
You may surprised by its value!
Let us suppose it is C:\Users\user123
There, you will find a folder named .IntelliJIdea, and sub-folder within named config.
If the .IntelliJIdea folder is stored on a network drive, you may find IntelliJ performance less than ideal.
Modify your idea.properties file. Possible full path: C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.1.5\bin\idea.properties
Modify options for config, system, plugins, and logs. Example: idea.config.path=${user.home}/.IntelliJIdea/config => idea.config.path=c:/local/path/.IntelliJIdea/config
Update
Official Knowledge Base article from JetBrains: http://intellij-support.jetbrains.com/entries/23348963

Related

How to configure IntelliJ products WITHOUT editing files in bin?

I'd like to set some specific options in idea.vmoptions and idea.properties for IntelliJ IDEA 14, but I don't have access to those files in C:\Program Files\... (yes, that's Windows, don't troll ;)
Is there a folder in %UserProfile% or an environment variable I could set to read those files (both vmoptions and properties!) from elsewhere?
Please don't suggest to copy the whole IDEA folder elsewhere, there's a reason why I can't access it. I would be interested in a Linux solution too, the same would most likely work on Windows.
My Research
For Mac there're specific instructions at Increasing Memory Heap, but for Linux and Windows it's just filename which are trivial to find out anyway.
I also found IntelliJ IDEA files locations, but it says can be modified in IDEA_HOME\bin\idea.properties which doesn't help since I can't access that file, but want to change properties in it.
Update: Simple Answer
Create IDEA_PROPERTIES and IDEA_VM_OPTIONS environment variables and point them to the files you want, restart IDE, done.
Also see documentation for more (and maybe report that it lacks any mention of IDEA_PROPERTIES).
You can use %USERPROFILE%\.IntelliJIdea14\idea%BITS%.exe.vmoptions on Windows as custom options file. I tried it and it works.
Another way that I haven't tried, but I think should work, is to copy idea.bat and edit it to use the file you need.

How to force IntelliJ to use a different home folder

I have a computer with two hard drives. In the first one, an SSD disk, I have Windows partition (C) and on the second one (D), a raid volume, I install all the programs. I also moved my user folders (desktop, documents, downloads, pictures and videos) to D:/Users/David.
After installing IntelliJ Idea on D:/Program Filles(x86) a .IntelliJIdea13 directory appeared on D:/Users/David. No problem with this as all was working nice. Then I installed Scala plugin, created a new SBT project and build it. After this, the .sbt directory used by SBT was in C:/Users/David/.sbt but the references to the libraries in my project are pointing to D:/Users/David/.sbt. The question is, how can I force IntelliJ Idea or Scala plugin to download the libraries to D:/Users/David.sbt?
Not 100% sure if this can be a solution, you can change the HOME folder of Intellij IDEA. Look for the folder where the idea executable is. In Linux I have on
~/applications/idea13/bin
On Windows you can check the properties of the menu item. There should be file idea.properties that contains the home folder location of the idea files.
You can find more information here that describe more details:
Locations can be changed by editing the following file:
IDE_HOME\bin\idea.properties
Follow the comments in idea.properties file to change the defaults,
make sure to un-comment the lines defining these properties:
idea.config.path
idea.system.path
idea.plugins.path
idea.log.path
On the other hand you can change the location of your project to D:/Users/David. you should also have a look inside the project folder, there should be a .idea folder with has a library directory. They contains the location of the libs used in the project with their paths.
As dawez allready answered, you should edit idea.properties to set config, system, plugins and log paths.
But if you want to change the user.home path, then you must edit idea.exe.vmoptions file. Just add the following at the end of the file:
-Duser.home=your_new_user_home_path
If you use idea64.exe then you should edit idea64.exe.vmoptions file.
JetBrains had added complete set of features to support such a case and this is described here:
Changing IDE default directories used for config, plugins, and caches storage

How to share Code Style settings between developers in IntelliJ

I would like all developers on my team to use the same default code style settings. We all use IntelliJ 11+ as our IDE and we use git as our source control system.
What is the easiest way to make sure they're all using the same settings? I thought there would be a way to check in the style settings into the project and have their editors discover them automatically, but that doesn't seem to be the case.
PS. I don't mind if developers consciously override some of the default settings with their own preferences, but I do want to make sure that we all at least start from a common set of default settings.
Code Style can be copied to project and saved in .idea/codeStyles to be shared via version control:
Copy to Project Click this button to create a copy of the current global scheme to the project level. After creating the copy, IntelliJ
IDEA suggests to switch to this new scheme at the project level.
The Settings Repository feature was introduced at IntelliJ IDEA 2016.
This option helps us to share IDE settings between different computers, including sharing settings between developers.
The settings are stored at Git repository, for example on GitHub or Bitbucket.
To setup Git repository we should set URL via Settings Repository menu option.
The developer can load remote settings, overwrite remote settings or merge local settings with remote ones.
The structure of Git repository with settings:
I used personal access token for GitHub authentication.
More information:
Settings Repository
Creating a personal access token for the command line
I came across this long after the fact, but thought I'd share if anyone ran into this. Add the following to your .gitignore
# IDE - IntelliJ
/.idea/*
# Keep the code styles.
!/.idea/codeStyles
/.idea/codeStyles/*
!/.idea/codeStyles/Project.xml
!/.idea/codeStyles/codeStyleConfig.xml
# Keep the inspection levels
!/.idea/inspectionProfiles
/.idea/inspectionProfiles/*
!/.idea/inspectionProfiles/Project_Default.xml
And of course, make sure your .gitignore also has a ! in front of it so these changes get picked up.
Basically, gitignore's recursive looking is a little wonky, so the below ignores a directory's contents, except for a subdirectory, then ignores that subdirectory's contents, except for the files we want.
codeStyleConfig lets you use per project settings, the project file itself is your actual code styles, and I included the Project_Default as it holds the warning levels, which you likely want if you're doing the code style work anyways.
You can create .editorconfig file in Your project (and it can be managed on directory level). More info on https://www.jetbrains.com/help/idea/configuring-code-style.html#editorconfig and https://editorconfig.org/
With this approach You can keep all Your code style settings in one file and it's not limited to IJ only.

IntelliJ idea and duplicate class issue

The dev env unfortunately is such that it creates a duplicate java file in a hidden directory under the same original root for every .java file. This is just a backup mechanism and can't change it. Good thing is this hidden dir name is same. I have Excluded this dir name pattern in the Settings of Intellij IDEA community edition 10.x. Yet, IDE reports this class as a duplicate one. Usages/References as well.
Bonus Q: Is there an eclipse equivalent of Ctrl-O in my IDEA to quickly navigate to methods?
How exactly did you exclude it? It should be added to the list of ignored folders in Settings | File Types. If it doesn't work, file a bug.
Bonus Q: Is there an eclipse equivalent of Ctrl-O in my IDEA to quickly navigate to methods?
Already replied here and here. Use Ctrl+F12.

Is there an easy way to put my entire installation of Intellij on a USB stick?

I'm considering switching from Eclipse to Intellij. One thing I like about Eclipse is that the whole installation is just a folder, and I can put that on a USB stick and copy it to another computer if I want. All of my plugins, settings, and everything else come with me and all I have to do is simply copy a folder.
Is there any way I could do this with Intellij?
Yes, it's possible, just copy the installation directory to the flash drive, then edit IDEA_HOME\bin\idea.properties file, change the values of idea.config.path and idea.plugins.path to the relative location, like: ../config and ../user-plugins (locations are relative to IDEA bin directory).
Now copy your original settings and third-party plug-ins (if any):
${user.home}/.IntelliJIdea10/config => usb:/IDEA_HOME/config
${user.home}/.IntelliJIdea10/config/plugins => usb:/IDEA_HOME/user-plugins
Note that it's not recommended to change idea.system.path variable, so that it remains on the fast local drive, otherwise it could affect IDEA performance and occupy a lot of USB drive space.
One thing you could also do is to use the ${idea.home} path variable. I described in an article how you can create a portable version of IntelliJ IDEA including a version of the JDK.
https://leolabs.org/blog/making-intellij-portable/
I hope it can help you, as this is my first article in English ;)
Regards
leolabs
In addition to the answer of CrazyCoder:
To copy the "system" folder of IntelliJ / PHPStorm to the usb memory stick is required if you want that IntelliJ / PHPStorm behave like a portable app.
To get the desired folders install IntelliJ / PHPStorm to your HDD and run it at least one time.
On Windows 7 the path is (copy the folders to your usb memory stick):
%USERNAME%\.WebIde10\config\ => usb:/IDEA_HOME/config
%USERNAME%\.WebIde10\system\ => usb:/IDEA_HOME/user-plugins
Note that user-plugins is not created at first start of IntelliJ / PHPStorm, so create it on your usb memory stick.
Edit the idea.properties as CrazyCoder told you and change all 3 values:
idea.config.path
idea.plugins.path
idea.system.path
open c:\Program Files\JetBrains\IntelliJ IDEA 14.1.3\bin\idea.properties
change # idea.config.path=${user.home}/.IntelliJIdea/config to idea.config.path=../PortableSetting/config
change # idea.system.path=${user.home}/.IntelliJIdea/system to idea.system.path=../PortableSetting/system
change # idea.plugins.path=${idea.config.path}/plugins to idea.plugins.path=../PortableSetting/config/plugins
change # idea.log.path=${idea.system.path}/log to idea.log.path=../PortableSetting/system/log
make PortableSetting folder in c:\Program Files\JetBrains\IntelliJ IDEA 14.1.3\
copy content of C:\Documents and Settings\User\.IntelliJIdea14\ to c:\Program Files\JetBrains\IntelliJ IDEA 14.1.3\PortableSetting\
copy c:\Program Files\JetBrains\IntelliJ IDEA 14.1.3 to USB and enjoy!
I wrote this answer for windows XP default directory.
for more information about default directory look at here.
I read other people answers and made an step by step answer.
You can use portableapps platform for portable intellij. Details description is here.