简体   繁体   English

Ubuntu 15.10:端口8080已被使用

[英]Ubuntu 15.10 : port 8080 already used

I have updated my OS from ubuntu 14.10 to Ubuntu 15.10. 我已经将我的操作系统从ubuntu 14.10更新到了Ubuntu 15.10。
I am developping J2EE webapps. 我正在开发J2EE Web应用程序。 Since I am on 15.10, Eclipse tells me that 8080 port is already used, I need to change it to 8181. It's annoying. 由于我使用的是15.10,Eclipse告诉我已经使用了8080端口,因此我需要将其更改为8181。这很烦人。
When I do a netstat -l , I don't see any 8080 listening port. 当我执行netstat -l ,看不到任何8080监听端口。

Does anyone know why it changed on 15.10? 有谁知道为什么它在15.10上发生了变化?

Try this command : 试试这个命令:

netstat -tulpn | grep :8080

You would get in the log something like this : 您将在日志中获得如下内容:

tcp        0      0 <IP_ADDR_OF_USED_INTERFACE>:8080             0.0.0.0:*                   LISTEN      6947/java

So for me, it is the java process that is using this port and his PID is 6947. For my case, it is fine because I am running JBoss and it is using the port 8080 for HTTP protocol. 所以对我来说,正是Java进程正在使用此端口,而他的PID是6947。对于我而言,这很好,因为我正在运行JBoss,并且它将8080端口用于HTTP协议。

Let's suppose you have another process (I had a similar problem with an NVidia service using 8080 port but over Windows). 假设您有另一个过程(使用8080端口但通过Windows的NVidia服务也遇到了类似的问题)。 You have 2 options : 您有2个选择:

  • Either configure your tomcat server to have an offset (I think this is what you are doing already) 要么将您的tomcat服务器配置为具有偏移量(我想这就是您已经在做的)
  • Either kill that process if it doesn't deserve to stay alive : 如果该过程不值得维持下去,则可以终止该过程:

    kill -9 6947 杀死-9 6947

Have you tried the -a switch for all sockets? 您是否尝试过-a用于所有套接字的开关? Once you verify that the port is in fact in use, you just need to find the process using it and kill it. 一旦确认端口确实在使用中,您只需要查找使用该端口的进程并杀死它即可。

I believe you can get the process with the -p switch. 我相信您可以使用-p开关获得该过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM