Reputation: 4095
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 ?
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.
Upvotes: 61
Views: 67440
Reputation: 41
For windows :
Firstly Go to the dropdown menu next to the Run/Debug buttons on the toolbar, then select "Edit Configurations...". Then do the following :
Upvotes: 2
Reputation: 127
If it is a Spring Boot Application:
Run both configurations!
Upvotes: 1
Reputation: 41
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
Upvotes: 4
Reputation: 271
For me, i copy the same configuration
-> It worked well.
Upvotes: 2
Reputation: 1
For Intellij:
Click Run->Edit Configurations->Modify Options->Allow Multiple Instances
Upvotes: 0
Reputation: 30341
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
.
Upvotes: 19
Reputation: 904
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.
Upvotes: 78
Reputation: 786
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.
Upvotes: 22
Reputation: 533
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.
Upvotes: 10
Reputation: 97138
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.
Upvotes: 39