一、Error running ‘Tomcat 8.5.29’ Address localhost:1099 is already in use
Reason: Port 1099 is occupied.
2. Solve
2.1 Solution 1 - End the occupation of port 1099
//1-查看端口占用,根据端口号1099,获取PID(进程ID)
netstat -ano | findstr "端口号"
//查看PID对应的进程
tasklist | findstr "进程ID"
//2-根据PID结束进程
taskkill /F /PID PID
或者
taskkill -f -pid PID
Specific commands :
//1-查看端口占用,根据端口号1099,获取PID(进程ID)
netstat -ano | findstr "1099"
//2-根据PID结束进程(这里执行上面netstat命令获得的PID是13080)
taskkill /F /PID 13080
screenshot:
2.2 Solution 2-Change port number 1099 to another port
After using method one or method two to solve the problem, start Tomcat again , and the port occupation error will no longer be reported .
3. Find and close processes under Linux
//1-查看端口占用获取PID(进程ID)
ps -aux | grep 进程名
//2-根据PID结束进程
kill -9 PID