【Spring Boot】项目端口号冲突解决方法,一步到位

启动项目遇到以下问题:

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

找到要启动的项目的配置文件application.properties ,没有的话可以在 resources 下手动创建。如图添加端口号设置代码,改一个不重复的端口号,启动项目即可成功。此处要注意的是,Spring Boot 可以用不同类型的配置文件,其语法也不相同,详情请参考【Spring Boot】Spring Boot 配置文件详解(application.yml、application-dev.yml、application-test.yml )

yaml 复制代码
# 应用服务 WEB 访问端口
server.port=8081

最后运行成功!

持续更新ing,动动小手,点点关注,后续更精彩!

相关推荐
渣哥12 分钟前
你以为 Bean 只是 new 出来?Spring BeanFactory 背后的秘密让人惊讶
javascript·后端·面试
YBN娜14 分钟前
设计模式-创建型设计模式
java·开发语言·设计模式
桦说编程28 分钟前
CompletableFuture API 过于复杂?选取7个最常用的方法,解决95%的问题
java·后端·函数式编程
冲鸭ONE32 分钟前
新手搭建Spring Boot项目
spring boot·后端·程序员
Moonbit34 分钟前
MoonBit Pearls Vol.10:prettyprinter:使用函数组合解决结构化数据打印问题
前端·后端·程序员
数智顾问40 分钟前
Flink ProcessFunction 与低层级 Join 实战手册:多流广告计费精确去重
java·spring boot·spring
世界哪有真情1 小时前
Trae 蓝屏问题
前端·后端·trae
一头生产的驴1 小时前
java整合itext pdf实现固定模版pdf导出
java·python·pdf
魔都吴所谓1 小时前
【python】快速实现pdf批量去除指定位置水印
java·python·pdf
Camel卡蒙1 小时前
数据结构——字典树Trie(介绍、Java实现)
java·数据结构