Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I am creating a simple client server application in IntelliJ, how should this work?

When creating a client server application (serversocket), would I create 2 seperate projects or can I do this in a single project?

I'm a little confused as to what type of project this will be, and more confused as to how I can launch both the client and server.

Or would I have to manually fire up terminal and execute the jars?

This will be a serversock and a client that connects to it and sends simple messages.

like image 666
codecompleting Avatar asked Oct 16 '25 12:10

codecompleting


1 Answers

Assuming that your client and server are started by invoking a Java main() method in a client and server class respectively, the simplest path is to have a single IntelliJ project. To launch the server, right-click on the class containing the main() method and select "run". Likewise for the client. When you do this, each program is added to IntelliJ's run configurations (a dropdown list to the left of the green arrow on IntelliJ's button bar). You can choose "Edit Configurations" from this dropdown to change how your main methods are run, for example, to pass in command line arguments.

like image 90
SingleShot Avatar answered Oct 19 '25 11:10

SingleShot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!