Start two instances of IntelliJ IDE
Asked Answered
S

10

194

Well my question is pretty simple, how do I start two instances of IntelliJ (community edition). When I have one instance started and I try to start another one, all that happens is that my started instance gets focus.

I'm developing Android applications using IntelliJ.

Any thoughts?

Stanwood answered 4/5, 2011 at 20:24 Comment(4)
Are you trying to open two projects or one project twice?Accost
Trying to open the Settings dialog of two projects at the same time and place them side-by-side.Auvergne
Bit late but just open new project using "File -> Open". It will ask you "This Window" or "New Window"Amorphous
@Amorphous that doesn't open a new instance. Just a new window.Entrechat
A
106

You need to configure each instance to use its own folders for config/plugins/system locations by editing idea.properties file on Windows/Linux and Info.plist on Mac. You can find the details in FAQ.

Note that normally it's not necessary since you can open multiple projects in different IDEA frames within the same instance using File | Open or Open Recent.

Aqualung answered 4/5, 2011 at 20:45 Comment(11)
Yep thats what I do as well if I need to open different projects. Although I always make sure I have only a single instance open for performance. Although you cannot open the same project twice am I right @CrazyCoder?Handcart
You can't open the single project twice in a single instance, but it's possible when running multiple instances.Aqualung
Tanks for a great answer, I usually use Visual Studio, therefore, my lack of knowledge about IntelliJ.Stanwood
If you are working on IDE, having one instance and opening projects in different windows makes sense but if you are running IntelliJ offline on command line you will need more than one instance. The git-hook I wrote inspects code errors in project before commit and it wont work if my IntelliJ IDEA is open.Chesser
It doesn't help when modal dialogs will lock down both windows effectively making dialogs single instance. So you can't for example compare config properties between the two different projects. Very annoying.Manumission
I need two instances with different JDKs (say 7 & 8) open at the same time. Can it be done?Lillian
@Lillian IntelliJ IDEA will not run on Java 7. Any JDK can be used as the project JDK to build and run your apps, you don't need to run several IDE instances for that.Aqualung
Hi @CrazyCoder, in my org we are using Java 7 for one old app and Java 8 for diff app. I have to change the JDK from 8 to 7 when I open/compile the Java 7 app. It works. The problem I face is when opening both the projects simultaneously. Is there any solution to this?Lillian
@Lillian it should not be a problem to have 2 projects using different Java versions and open them at the same time. If it doesn't work for you, you should report a bug at youtrack.jetbrains.com/issues/IDEA and provide the samples to reproduce it.Aqualung
Thanks @CrazyCoder. I may to have to report it.Lillian
This is 2 windows with 2 configurations - but still one instance.Wilie
B
149

Press Ctrl+Alt+S

Choose Appearance & Behavior, then System Settings, check radio button: Open project in new window.

enter image description here

Bal answered 10/2, 2015 at 15:23 Comment(7)
Single window doesn't imply single instance.Scutch
See comment of @JeffMercado in the other answer: If you put 2 projects side by side and open a modal dialog (like settings) in one, the other windows is completely frozen, too. So this is not really a solution.Varese
This does not open the same project in another window if that project is already open.Mariano
You can switch between opened projects using Ctrl+Alt+] (next project) and Ctrl+Alt+[ (previous project).Embryonic
This opens new window of same instance of Intellij. eg: open project settings in one project, try to do same in the other one. You can't because they're both one instance and one modal window blocks everything. If that was new instance, nothing you've done in the first could have affected the second.Wilie
command+, if you're using MacOSGringo
I have no idea why this answer is upvoted. It doesn't answer the question.Entrechat
A
106

You need to configure each instance to use its own folders for config/plugins/system locations by editing idea.properties file on Windows/Linux and Info.plist on Mac. You can find the details in FAQ.

Note that normally it's not necessary since you can open multiple projects in different IDEA frames within the same instance using File | Open or Open Recent.

Aqualung answered 4/5, 2011 at 20:45 Comment(11)
Yep thats what I do as well if I need to open different projects. Although I always make sure I have only a single instance open for performance. Although you cannot open the same project twice am I right @CrazyCoder?Handcart
You can't open the single project twice in a single instance, but it's possible when running multiple instances.Aqualung
Tanks for a great answer, I usually use Visual Studio, therefore, my lack of knowledge about IntelliJ.Stanwood
If you are working on IDE, having one instance and opening projects in different windows makes sense but if you are running IntelliJ offline on command line you will need more than one instance. The git-hook I wrote inspects code errors in project before commit and it wont work if my IntelliJ IDEA is open.Chesser
It doesn't help when modal dialogs will lock down both windows effectively making dialogs single instance. So you can't for example compare config properties between the two different projects. Very annoying.Manumission
I need two instances with different JDKs (say 7 & 8) open at the same time. Can it be done?Lillian
@Lillian IntelliJ IDEA will not run on Java 7. Any JDK can be used as the project JDK to build and run your apps, you don't need to run several IDE instances for that.Aqualung
Hi @CrazyCoder, in my org we are using Java 7 for one old app and Java 8 for diff app. I have to change the JDK from 8 to 7 when I open/compile the Java 7 app. It works. The problem I face is when opening both the projects simultaneously. Is there any solution to this?Lillian
@Lillian it should not be a problem to have 2 projects using different Java versions and open them at the same time. If it doesn't work for you, you should report a bug at youtrack.jetbrains.com/issues/IDEA and provide the samples to reproduce it.Aqualung
Thanks @CrazyCoder. I may to have to report it.Lillian
This is 2 windows with 2 configurations - but still one instance.Wilie
A
15

CrazyCoder has roughly the right idea. However, setting the config file alone was not sufficient for me to run multiple instances. Here are my steps to get this going (in GNU/Linux, I am sure you can figure out equivalent in other systems):

  1. Create a folder/directory per instance you want to run.

    mkdir -p ~/idea/instance-0
    
  2. Go to the installation directory (e.g. /opt/intellij) and copy the idea.properties (in bin) file over to your instance directory.

    cp /opt/intellij/bin/idea.properties ~/idea/instance-0/
    
  3. Copy 3 more directories: system, plugins, and config. I highly recommend doing this without the running instance

    cp -r /opt/intellij/system ~/idea/instance-0/
    cp -r /opt/intellij/plugins ~/idea/instance-0/
    cp -r /opt/intellij/config ~/idea/instance-0/
    mkdir ~/idea/instance-0/log
    
  4. Open your idea.properties file and update the configurations for your directories:

    #---------------------------------------------------------------------
    # Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
    #---------------------------------------------------------------------
    idea.config.path=${user.home}/config
    #---------------------------------------------------------------------
    # Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
    #---------------------------------------------------------------------
    idea.system.path=${user.home}/system
    #---------------------------------------------------------------------
    # Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes.
    #---------------------------------------------------------------------
    idea.plugins.path=${user.home}/plugins
    #---------------------------------------------------------------------
    # Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
    #---------------------------------------------------------------------
    idea.log.path=${user.home}/log
    
  5. Now, you can start IntelliJ with the new setup:

    IDEA_PROPERTIES=~/idea/instance-0/idea.properties /opt/intellij/bin/idea
    

Obviously, you probably want to put the command in a script file for invocation. This seems to work for me.

Ansilme answered 15/6, 2017 at 17:14 Comment(1)
It works, but ensure you use the specific export env var name: IDEA_PROPERTIES, STUDIO_PROPERTIES, PHPSTORM_PROPERTIES, WEBIDE_PROPERTIES, etc. And ensure you don't use short dirs: "~/" instead of "/home/myname"Klopstock
B
13

File->Settings->General and in section "Startup/Shutdown" check "Confirm window to open project in"

Budworth answered 27/3, 2012 at 12:37 Comment(3)
Great, that's what I'm looking for.Algorithm
This only makes IJ open a new window, not a new instanceReviel
It has changed in 2018. The link is now http://www.jetbrains.com/help/idea/system-settings.htmlLivvy
S
9

With Ultimate 2020.2, go to Appearance & Behavior > System Settings in the settings dialog and select the "Ask" option for "Open project in"

Screenshot of settings dialog

Saddlecloth answered 11/4, 2022 at 17:2 Comment(0)
B
4

As per the directions from jetbrains you'll need go to the 'General' page of the 'Settings' dialog and chose 'Open project in a new window'. Then proceed to open a project as you normally do. IntelliJ should then startup a completely new instance.

Bedchamber answered 30/10, 2013 at 13:45 Comment(1)
No, it doesn't start a new instance, instead the current instance controls a second window only (as the setting says). You see the difference if you later open "settings" in one of those two windows and try to click in the other window. With separate instances only one would get modal, but here both windows are affected, so it is a single instance.Varese
T
4

There is an other very quick way of doing it. There is always an EAP version of the IDE and it can run at same time with the current one. For example I am using AppCode 2017.2 and 2017.3 EAP in parallel.

Tareyn answered 6/10, 2017 at 14:38 Comment(1)
I just tried this, but running the 2021.3.1 EAP just activates the running 2021.3 version.Raggedy
B
1

Go go to IntelliJ | Tools | Create Command-line Launcher...

Keep the defaults (which creates a binary named "idea"):

enter image description here

Now, go to your command line.

Cd to your project directory and type: idea .

This will create a .idea directory for IntelliJ configurations for that project, which it will re-use each time to start IntelliJ from that directory.

You can now go to a different project directory and type: idea .

Assuming you left the previous IntellJ IDE open, you will now have two IntellJ IDEs open, one for each project.

Notes:

1) If your project uses environment variables, then I'd recommending opening a separate terminal tab/window for each project and set that project's environment variables before running: idea .

2) Depending on what you're trying to accomplish, you may need to modify your classpath (or settings like Project GOPATH) for each IntelliJ instance.

Barghest answered 26/9, 2014 at 13:25 Comment(0)
P
0

My answer is not directly related to the question but its a solution for some cases where we think we need 2 Intellij instances.

For my issue I was thinking to launch 2 Intellij instances. But after careful thinking and searching for other options, I found an easy and quick solution and I wanna share with the community

If you are looking to compare files between different branches, and you wanna compare the difference, that can be done with git comparison. You don't need 2 different Intellij instances.

My Case:
In my case, I wanted to copy very specific code from 1 branch to another and I wanted to compare the difference between the code. The restriction was, I can't do git merge or cherry-pick because we didn't want full commit to be part of new branch. Just few necessary lines were required in the new branch.

My Solution:

  • Select the branch
  • Open the file where you wanna insert code
  • Right Click -> Git -> Compare with... (refer to pic)
  • Select the branch and you will get the difference
  • Append or Copy the difference
  • If you have new files or directories, you can create it manually and copy-paste the content

enter image description here

I know this answer doesn't directly relates to what has been asked, but sometimes we miss alternative solutions.

Hope this can be helpful as an alternative solution.

Premonitory answered 13/1, 2022 at 8:3 Comment(0)
C
-1

In addition to the above comments from @crazycoder and @magice, Make sure that you are not trying to load Pycharm with the same project two times which happened to me!!!.

For example, in windows10 already loaded with ONLY one project in PyCharm and tried to load another Pycharm instance by clicking on the PyCharm desktop shortcut or from task-bar if added. In this case, Pycharm will not load the second instance.

I have wasted some time here. So, wanted to share with the community as it will help someone out there!!

Cheers,

Carrico answered 14/1, 2022 at 19:59 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Sanies

© 2022 - 2024 — McMap. All rights reserved.