How to configure IntelliJ products WITHOUT editing files in bin? - intellij-idea

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.

Related

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

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

Flash Builder 4.6 linked Resources not working with ANEs and Certs

I'm having an issue with linked Resources in Flash Builder. I work in a team environment where we use Linked Resources extensively. We just started developing ANEs and noticed that while linkedResources are used in the libraryPathEntry, in the buildTargets like anePathEntry and airCertificatePath, the absolute path is stored. I tried editing the .actionScriptProperties files directly, modifying the buildtarget absolute paths to linked resource equivalents using the libraryPathEntry as a guide but FlashBuilder complained when loading the project.
Is there a way to get the buildTargets to respect linkedResources and not save the absolute path? I'm trying to avoid the draconian way where all developers must have the exact same directory structure.
Thanks!
Randy
My team had this exact problem and all attempts to fix it with relative paths or workspace macros (i.e. ${PROJECT_LOC}) failed. It seems as if the team in charge of Flash Builder neglected to support relative paths in these particular dialogs, despite them being supported elsewhere.
Here is what we have done to fix this problem. I am assuming you are on a Mac/Linux or the like. If not, the concept here can still be applied.
Most of our projects already have a "set up" bash script that contributors run when they get code. Inside of that script, we simply set up a couple of symbolic links from the user specific absolute path, to a new absolute path with a "common" user. The script first creates the directory if it does not exist, and then creates the symlinks.
sudo mkdir -p /Users/common/<project>/
sudo ln -f -h -s ~/path/to/certificate/dir /Users/common/<project>/certificates
Obviously you can use whatever you like and whatever makes sense for the common path.
Now, in your .actionScriptProperties file you can change the location pointed to by the provisingFile and airCertificatePath to this new common absolute path.
<buildTarget ... provisioningFile="/Users/common/<project>/certificates/provisionfile.mobileprovision" ... >
<airSettings airCertificatePath="/Users/common/<project>/certificates/cert.p12" ... >
We actually take this a step further (and I suspect you will need to also) and create common symlink paths for the ANE files themselves. This ends up changing the anePathEntry to the common path as well.
<anePathEntry path="/Users/common/<project>/anes/some.ane"/>
You will need to make sure that you either hand edit the .actionScriptProperties file directly, or type in the fully qualified symlink path into the dialogs directly. Any attempt at using the Finder dialog launched by Flash Builder to navigate to the files in the common location resulted in the symlinks being auto-resolved to their actual locations.
The script requires sudo, which as I'm sure you know, will require that the users of it know their root password. Maybe some more bash savvy folks can suggest a way around sudo if this is not an option for you.
This will work for android stuff as well I believe. I don't know if that matters to you or not.
Hope this helps!
It looks like this issue was called out in the Flash Builder 4.6 known issues:
http://helpx.adobe.com/flash-builder/kb/flash-builder-4-6-known.html
https://bugs.adobe.com/jira/browse/FB-32955
The bug is apparently fixed but I haven't been able to check the new Flash Builder 4.7 beta yet:
http://blogs.adobe.com/flex/2012/08/flash-builder-4-7-beta-is-here.html

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.

Setting up StyleCop for team development

We are trying to setup stylecop for a team development environment. So far what we have done is:
Checked the files into source control
Create an environment variable on every machine that points to that location (each dev has source checked out to a different location, this solves that)
Add the tag to the project as follows:
This works great, but VS complains that the file is unsafe, and I know to fix that we have to mark is safe in the registry. We wanted to create a .reg file to import this setting and make it easier for everyone. Can we use that environment variable in the path? I have tried the snippet below, but that doesn't seem to work. Is the syntax for an environment variable different?
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports]
"StyleCop.4.3"="%StyleCopLocation%\\Microsoft.StyleCop.Targets"
Why you need to host that Targets file in a global place? Everyone can install a copy of StyleCop.
If you in fact plan to share StyleCop settings, please configure the projects to use a project locally setting file (*.SourceAnalysis). You can check in this file along with your projects, and then everyone is in sync.