8080端口被占用,最快解决方法不是重启电脑

解决方法:cmd 之后 懂得直接拿代码,不懂的继续看

netstat -aon|findstr "8080"
taskkill /pid 6828 /f  
6868 代表占用8080的进程pid号

当然还有一种更直接的方法:重启电脑,直接解决

一、8080被占用问题描述

在做java项目的时候,总会碰到8080端口被占用问题,非常荣幸,我在同一天碰到了四五次,我随即立马做了份笔记,今天有人跑来问我我的8080被占用咋解决的,他百度一直看不懂,所以我决定做一篇我认为大家能看懂的教程,因为现在没有8080被占用问题,所以我打开idea,不断地点击debug(shift+F9)run(shift+F10),终于让我把这个问题复现出来了,发生错误提示如下
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
[00:25:59:587] [ERROR] - org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter.report(LoggingFailureAnalysisReporter.java:42) -


APPLICATION FAILED TO START


Description:
The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.
Action:
Verify the connector’s configuration, identify and stop any process that’s listening on port 8080, or configure this application to listen on another port.
[00:25:59:589] [INFO] - org.springframework.scheduling.concurrent.ExecutorConfigurationSupport.shutdown(ExecutorConfigurationSupport.java:208) - Shutting down ExecutorService ‘applicationTaskExecutor’
Disconnected from the target VM, address: ‘127.0.0.1:65034’, transport: ‘socket’

Process finished with exit code 1
在这里插入图片描述

二、解决办法

① 开始---->运行---->cmd(window+R组合键,输入cmd),确定,调出命令窗口
在这里插入图片描述

② 输入命令: netstat -aon|findstr “8080”,这个命令是查看占用8080端口进程,netstat -aon,命令是查看所有进程,我们这里只看占用8080的端口
在这里插入图片描述

③ 输入命令: taskkill /pid 12912 /f
注意这里我们是输入12912是对应的我这里的占用的pid
在这里插入图片描述
④.杀完了我们可以在调用第一个命令看一下是否杀完了,这样我们的8080 就可以继续用了。

  • 8
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值