This README contains the instructions to run the code for the second assignment of the course Parallel and Distributed Computing of the Bachelor in Informatics and Computing Engineering at the Faculty of Engineering of the University of Porto. The assignment involves creating a chatroom application using Java, where multiple clients can connect to a server and communicate with each other. The server uses an AI bot (Ollama) to respond to user messages.
Before running the application, ensure you have the necessary software installed on your machine. Here is a list of the required software:
- Docker (https://www.docker.com/get-started)
- Java Development Kit (JDK) 21 (https://jdk.java.net/21/)
- IntelliJ IDEA (https://www.jetbrains.com/idea/)
To use the AI chatbot in your application, you need to run the Ollama container. Follow these steps to set it up:
sudo docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama14 ollama/ollama
sudo docker exec -it ollama14 ollama run llama3Note: If you already have a container named ollama14, you may need to remove it first:
sudo docker rm -f ollama14To run the Java application, follow these steps:
-
Open IntelliJ IDEA and load the project folder.
-
Make sure your project SDK is set to Java 21.
Open a terminal and change directory to the src folder inside the project:
cd srcIn one terminal, compile the Server.java file and then run the server application:
javac Server.java
java ServerOpen one or more additional terminals, navigate to the src folder, then compile and run Client.java:
javac Client.java
java Client- To exit either the Server or Client programs, press CTRL+C in the terminal where they are running.
This assignment was developed by:
- Afonso Neves (up202108884@up.pt)
- Francisco Mendonça (up202006728@up.pt)