Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caused by: java.net.BindException: Address already in use: bind

I am trying to run a spring boot application by clicking on Run as -> Spring Boot App. I am getting the error as :

Caused by: java.net.BindException: Address already in use: bind

When I use netstat command, I see the below without process Ids:

netstat -na | find "8080"

TCP    0.0.0.0:8080   0.0.0.0:0    LISTENING

TCP    [::]:8080      [::]:0       LISTENING

Notice - I am running my code on windows machine

How do I kill these processes?

like image 713
user10411549 Avatar asked Sep 25 '18 06:09

user10411549


People also ask

What is Java net BindException address already in use?

BindException: Address already in use: JVM_Bind is a common exception in Java with applications trying to connect on a particular port and some other processes either Java or non Java is already connected on that port.

What is Java net BindException?

The java. net. BindException is an exception that is thrown when there is an error caused in binding when an application tries to bind a socket to a local address and port.

What went wrong Java net BindException address already in use Cannot bind?

it means that you are trying to use a port that is already open. check to see whether the port that you want to open is already open or not. also it may cause that your fireWall do not allows the application to listen on the port.


1 Answers

You can change your application's port number by providing something like server.port=4567 in your application.properties.

OR

You can follow the steps as mentioned in http://www.codeman.in/blog/windows-kill-process-by-port-number-157 to kill process running on a port number:-

enter image description here

like image 125
Kartik Avatar answered Sep 30 '22 06:09

Kartik