How to pass JVM options when starting IDE (windows)?

Based on that topic I would like to start phpStorm with following params "-Didea.plugins.path=path\config\plugins". I tried to create a shortcut: "path_to_ide" -Didea.plugins.path=path\config\plugins when I launch IDE from it I receive following error

How can I change plugins path during starting IDE?

6 comments
Comment actions Permalink

Hi there,

Check https://intellij-support.jetbrains.com/hc/en-us/articles/207240985 on how to change such paths in general.

Not sure about shortcut way.

0
Comment actions Permalink

The problem I need to solve is the plugin management per projects groups. I can divide my projects into 3-4 groups and create separate plugin configs per group. The simplest way to get this work is to download 3-4 instances of phpStorm and configure each of them separately. However I read that there is an option to provide plugins config path via JVM parameters when starting IDE. Andrey Dernov siad that is possible in all IDEs. It would allow me to have got only one instance and load proper config on start. Shortcut way was my shot, but maybe it has to be done using some more sophisticated way like batch file or something else. I can't find anything about that in DOC.

I tired also to copy phpstorm64.exe file and change the name for example to: phpstorm64-symfony.exe Then I copied phpstorm64.exe.vmoptions and changed filename to phpstorm64-symfony.exe.vmoptions. But when I launched phpstorm64-symfony.exe and tried to edit custom VM options via IDE, the phpstorm64.exe.vmoptions was loaded. I thought that vmoptions file will be loaded based on exe's filename.

0
Comment actions Permalink

.vmoptions file name is NOT based on EXE name but on a product name: https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties

>However I read that there is an option to provide plugins config path via JVM parameters when starting IDE. Andrey Dernov siad that is possible in all IDEs.

It's possible that you may have misunderstood his words / the context was different. Can you share the link to his comment?

AFAIK JVM options can be changed via parameters .. but the option you are after is not actually a JVM parameter as far as I'm aware.

 

As you can see from my link in my previous comment, "Locations can be changed by editing idea.properties file."

There is a comment in my first link that says how exactly it can be done for Windows (comment by Gustavo Luckmann Fabro) -- how to point to a custom idea.properties location and launch IDE: https://intellij-support.jetbrains.com/hc/en-us/articles/207240985/comments/115000104264

0
Comment actions Permalink

I read the discussion under the link you provided but I have missed that comment which you were pointing to. I have just tried to do everything from Gustavo's comment and it seems to work. It is enough to leave the system directory shared by both instances and only separate the config directories. This way I don't have to pay the cost of ca. 1,5GB per project's group and it seems to work as expected.

>>However I read that there is an option to provide plugins config path via JVM parameters when starting IDE. Andrey Dernov siad that is possible in all IDEs.

>It's possible that you may have misunderstood his words / the context was different. Can you share the link to his comment?

I have linked his comment at the beginning of my post. You can read about it here -> https://intellij-support.jetbrains.com/hc/en-us/community/posts/206167659-Discuss-vote-IDEA-60841-Allow-to-enable-disable-plugins-on-a-per-project-basis?page=1#community_comment_360000707299

 

0
Comment actions Permalink

This is what I did (NOTE: I'm not running any IDE Settings Sync/Repository plugins -- those plugins are disabled in my setup).

1. Created an empty folder at D:\PhpStorm

2. Create 2 empty folders inside: "config" and "system"

3. Copied idea.properties from IDE setup folder (C:\Program Files\JetBrains\PhpStorm\bin) to D:\PhpStorm

4. Inside that newly copied idea.properties edited 2 lines to point to a new location (everything else left as is):

5. Created phpstorm.bat file with the following content:

@echo off
SET PHPSTORM_PROPERTIES=D:\PhpStorm\idea.properties
start "" "C:\Program Files\JetBrains\PhpStorm\bin\phpstorm64.exe"

6. Created a shortcut to that file on my Desktop.

7. Launched it ... and it launched IDE with blank profile (no settings or past projects/plugins etc) -- it's is expected (as I have pointed IDE to use blank folders so it created config from scratch).

 

Based on what you have stated so far -- the mistake most likely is in SET PHPSTORM_PROPERTIES line -- it must point to actual idea.properties file and NOT a folder (I guess file can be named differently (e.g. my-special-idea.properties) as option points to the exact file name).

8. If I now launch IDE normally, it will launch my usual config (so old and new config work). I did not do any deeper checks, but it should work OK.

 

>I have linked his comment at the beginning of my post. You can read about it here -> https://intellij-support.jetbrains.com/hc/en-us/community/posts/206167659-Discuss-vote-IDEA-60841-Allow-to-enable-disable-plugins-on-a-per-project-basis?page=1#community_comment_360000707299

Passing those params via shortcut does not work for me either: tried both \ and / as path separator. Seeing the same error .. so I'm still doubt that it's possible (unless I'm also doing something wrong).

"C:\Program Files\JetBrains\PhpStorm\bin\phpstorm64.exe" -Didea.config.path=D:/PhpStorm/config -Didea.system.path=D:/PhpStorm/system

P.S. As far as I know passing "-D" kind of parameters are actually should be done for Java.exe and not phpstorm64.exe (which is launcher AFAIK). Maybe if you pass it to the original phpstorm.bat it will work... not sure).

0
Comment actions Permalink

I had got problem with path to idea.properties. I tried to edit my comment as quick as it was possible, but there is "Pending approval" tag on it, so you may not see my edited response. Everything works fine right now. I can remove system directory and leave only config one. I can also add path to my project in batch file start "" "path_to_ide\bin\phpstorm64.exe" path_to_project

Thank you for your help. Right now I can create as many combinations as I want and there is no problem with updates as there is only one 'exe' file. Also there is common system directory, so cache is kept in one place.

There are only 2 small disadvantages: you have to disable plugin synchronization option in all IDEs instances except one and you have to change paths after upgrade. But for me it's the best workaround related to plugin management per project. If someone else needs to do the same there are two batch files as example

@echo off
SET PHPSTORM_PROPERTIES=path\.PhpStorm2019.2-symfony\idea.properties <- in symfony directory I keep plugins pack dedicated my Symfony projects
start "" "idepath\PhpStorm 2019.2\bin\phpstorm64.exe" path_to_project_A <- this will launch my symfony project A

@echo off
SET PHPSTORM_PROPERTIES=path\.PhpStorm2019.2-laravel-jira\idea.properties <- I keep plugins pack dedicated my Laravel projects with Jira integrations
start "" "idepath\PhpStorm 2019.2\bin\phpstorm64.exe" path_to_project_B <- this will launch my laravel project B

 

 

0

Please sign in to leave a comment.