###環境
Windows10
SpringBoot 2.5.2
###エラーログ
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-06-30 22:16:21.436 ERROR 8536 --- [ restartedMain] 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.
###8080を使用しているプロセスを終了する
ちょっとしらべたらLinuxコマンドは出てくるけど、Windowsはあまり出てこなかったのでメモしときます。
コマンドプロンプトで以下のコマンドを実行
調べるとき
$ netstat -nao | findstr 8080
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 25952
TCP [::]:8080 [::]:0 LISTENING 25952
最後の25952がPIDなので、終了させる
終了するとき
$ taskkill /f /pid 25952
成功: PID 25952 のプロセスは強制終了されました。