Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i close an opened port in Windows 7?

Tags:

java

windows

when i try to start my java based server there is a message that says the port is already in use... And all my java web servers are stopped... So if anyone can help me i will appreciate it...

like image 941
Alejandro Avatar asked Nov 29 '22 04:11

Alejandro


2 Answers

If there is really still a process that has the port open, you can easily check for that (and close the process) via TCPView. It might be that the port is just lingering (for example due to not being shutdown properly), in which case you'd have to wait for the socket to close and check that the code is clear with regard to that.

like image 92
Jim Brissom Avatar answered Dec 06 '22 16:12

Jim Brissom


I was trying to establish socket communication between PC(JAVA Server)<-->Android(Client)

on Debugging, popped the problem : Address already in use

instant/feasible resolution i found out was to:

  • run cmd as adminstrator
  • netstat -abn
  • find the process listening to the port of intrest
  • terminate the process from task manager

PS : Unlike from an external application mentioned in previous answers, steps in this answer allows you to find out the used ports with the resources already present.

like image 26
Anup Avatar answered Dec 06 '22 16:12

Anup