IDEA运行程序报错:Web server failed to start. Port 8081 was already in use.

IDEA运行程序报错:Web server failed to start. Port 8081 was already in use._第1张图片
原因:端口号已经被占用

解决办法:在resource文件夹下new File - application.properties,修改端口号(端口号可以随便改,其他都不用改)

server.port=${port:8083}

成功解决:
IDEA运行程序报错:Web server failed to start. Port 8081 was already in use._第2张图片

你可能感兴趣的:(java,spring)