Start two instances of IntelliJ IDE

Intellij Idea

Intellij Idea Problem Overview


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?

Intellij Idea Solutions


Solution 1 - Intellij Idea

Press Ctrl+Alt+S

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

enter image description here

Solution 2 - Intellij Idea

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.

Solution 3 - Intellij Idea

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

Solution 4 - Intellij Idea

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.

Solution 5 - Intellij Idea

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.

Solution 6 - Intellij Idea

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.

Solution 7 - Intellij Idea

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.

Solution 8 - Intellij Idea

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.

Solution 9 - Intellij Idea

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,

Solution 10 - Intellij Idea

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

Solution 11 - Intellij Idea

Just install two different versions of IDE.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFelixView Question on Stackoverflow
Solution 1 - Intellij IdeaJames GrahamView Answer on Stackoverflow
Solution 2 - Intellij IdeaCrazyCoderView Answer on Stackoverflow
Solution 3 - Intellij IdeaMr. DIView Answer on Stackoverflow
Solution 4 - Intellij IdeamagiceView Answer on Stackoverflow
Solution 5 - Intellij IdeaharryView Answer on Stackoverflow
Solution 6 - Intellij IdeaOlcay ErtaşView Answer on Stackoverflow
Solution 7 - Intellij Ideal3xView Answer on Stackoverflow
Solution 8 - Intellij IdeaMuhammad TariqView Answer on Stackoverflow
Solution 9 - Intellij IdeaKirkishView Answer on Stackoverflow
Solution 10 - Intellij IdeacboloView Answer on Stackoverflow
Solution 11 - Intellij IdeaSulaymon HursanovView Answer on Stackoverflow