To run the program, where the server is NetworkApplication and the client is LobbyWindow, follow these steps:
- Install Java Development Kit (JDK) (version 8 or higher).
- Install Maven (if not already installed).
- Ensure your
JAVA_HOMEandMAVEN_HOMEenvironment variables are set correctly.
- Open a terminal and navigate to the root directory of the project (where
pom.xmlis located). - Run the following command to build the project:
mvn clean install
- This will compile the code and generate the required
.classfiles in thetargetdirectory.
- Navigate to the
src/main/java/com/network/networkdirectory. - Run the
NetworkApplicationclass using the following command:java -cp target/classes com.network.network.NetworkApplication
- Alternatively, if you are using an IDE like IntelliJ IDEA or Eclipse, locate the
NetworkApplicationclass and run it directly from the IDE.
- Navigate to the
src/main/java/com/network/UI_managerdirectory. - Run the
LobbyWindowclass using the following command:java -cp target/classes com.network.network.UI_manager.LobbyWindow
- Similarly, you can run the
LobbyWindowclass directly from your IDE.
- Once both the server and client are running, ensure that the client (
LobbyWindow) can connect to the server (NetworkApplication). - Check the logs or console output for any errors or successful connection messages.
- Interact with the client (
LobbyWindow) to test its functionality. - Monitor the server (
NetworkApplication) for any incoming requests or operations.