You can use the following command to terminate the process occupying port 8080:
- First, identify the process occupying port 8080:
sudo lsof -i :8080 - Then terminate the process:
Here, PID refers to the process ID identified in the first step.sudo kill <PID>
Alternatively, you can use a single command to perform both steps:
sudo kill $(sudo lsof -t -i:8080)Alternatively, you can prevent the program from being bound to port 8080 by modifying its configuration file or using command-line parameters.