52

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

9 Answers 9

69

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

0
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.

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

14

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

2
  • 1
    @Allema_s Glad it helped because 2 people downvoted this answer for some reason 🙃
    – George
    Jan 30, 2022 at 20:27
  • It works on Windows too, thanks for help / IntelliJ IDEA 2022.3.2 Feb 22 at 11:22
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.

0
1

Find this in Edit Configuration:

enter image description here

0

For Intellij:

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

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.

0
IntelliJ IDEA 2023.2.1
Build #IU-232.9559.62, built on August 23, 2023
Click Run->Edit Configurations->Modify Options->Allow Multiple Instances

Run/Debug Configurations->Modify Options

Run/Debug Configurations->Modify Options-Allow Multiple Instances

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.