You can build this project one at the command line with Apache Ant or through the NetBeans GUI.
You only need to use the NetBeans configuration menus to switch between building or running the client and the server.
In order to build the project through NetBeans:
- Use the "Open Project" menu item and point it to the cloned project.
- Set the config to "Server" and click build.
- Set the config to "Client" and click build.
In order to run the project through NetBeans:
- Set the config to "Server".
- Right Click the project and click run.
- Set the config to "Client".
- Right click the project and click run.
- Repeat steps 3 and 4 to get a second client.
Building the client or server with Apache Ant requires you to set a configuration variable. This variable will be set to the last NetBeans build target by default
In order to build
- Change to the directory of the cloned project.
- Run "ant -Dconfig=Server" to build the server.
- Run "ant -Dconfig=Client" to build the client.
In order to run the project on the command line:
- Open 3 shells and cd to the directory of the cloned project.
- Run "java -jar dist/Server/BattleshipServer.jar" in one shell.
- Run "java -jar dist/Client/BattleshipClient.jar" in the other shells.