51

I'm using IntelliJ to develop my client-server application and just discovered Compounds. Basically I can run my client and my server at the same time and it's saving me useless manipulations everytime I want to test. However, I would like to test my application with 2 clients and 1 server since it's a game and have no point being played alone. IntelliJ does not let me add the same application twice in a compound. How can I achieve that ?

What I have now: Compound configuration

Plus, I can't tell a run configuration to run itself before launch. When I click the button in the following, image, the configuration I am on does not show up.

Can't run itself

Winter
  • 3,894
  • 7
  • 24
  • 56

8 Answers8

68

Click Run->Edit Configurations. For the file requiring multiple instances, click on Allow parallel run. You can do this for multiple files. Click on Apply. enter image description here

34

You can copy the run configuration of your client, give it a different name and leave all other parameters unchanged. Then you'll be able to select the two copies in the "Compound" run configuration.

yole
  • 92,896
  • 20
  • 260
  • 197
22

I had same problem with Intellij 2018.2.5 and solved it by uncheck "single instance only" check box in "run/debug configuration."

By the way each time I run Spring class (that have main method) new instance will be created.

The important point is never forget that we can't run application on same port. so it's necessary to set server.port = 0 in application.properties to run application on random port. enter image description here

Omid Mohebbi
  • 776
  • 7
  • 12
13

On Mac:

Go to Run > Edit Configurations... then select the application. Click the Modify options drop-down, and turn on Allow multiple instances.

Remember to click Apply then OK.

Image showing setting to turn on

George
  • 25,988
  • 10
  • 79
  • 133
10

Click on 'Edit Configuration', when the pop-up appear. On the right hand side you wll see check boxes ,one of them says:'Allow run in parallel' - check this one.

Denise Ignatova
  • 465
  • 4
  • 7
1

Find this in Edit Configuration:

enter image description here

Eljah
  • 4,188
  • 4
  • 41
  • 85
0

For Intellij:

Click Run->Edit Configurations->Modify Options->Allow Multiple Instances

Tajdin
  • 1
  • 1
0

For me, i copy the same configuration enter image description here

  1. I run my first Application.
  2. I change the port of something not to be duplicated
  3. I run my second Application.

-> It worked well.

Bui Hai Duong
  • 191
  • 1
  • 9