启动java后端程序报错:
bash
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2026-02-12T09:26:15.311+08:00 ERROR 35234 --- [model] [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 8080 was already in use.
Action:
Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
Process finished with exit code 1
这是典型的 Spring Boot 报错:
Port 8080 was already in use
说明 8080 端口已经被别的进程占用了。
你本机已经有一个服务在跑(很可能是你之前启动的项目)。
如果是是 mac,执行:
bash
lsof -i :8080
会看到类似:
bash
java 12345 yourname ... TCP *:8080 (LISTEN)
记住 PID(比如 12345)
然后执行:
bash
kill -9 12345
再重新启动项目即可。