Languages
[Edit]
EN

IntelliJ / Spring / Tomcat - Error running 'my_project': Unable to open debugger port (127.0.0.1:50188): java.net.BindException "Address already in use: JVM_Bind"

4 points
Created by:
Root-ssh
175460

In this article I would like to show how to solve the problem when we are not able to run a Spring Framework based project in debug mode in IntelliJ IDEA because some port is in use by some process that wasn't stopped correct way (the case mentioned in the article uses Tomcat as server run on Windows).

The article describes situation when IntelliJ IDEA displays:

Error running 'my_project': Unable to open debugger port (127.0.0.1:50188): java.net.BindException "Address already in use: JVM_Bind"

Intellij IDEA - error running 'my_project': Unable to open debugger port (127.0.0.1:50188): java.net.BindException "Address already in use: JVM_Bind"
Address already in use: JVM_Bind

There are 2 solutions:

  1. Kill process that uses debug port,
  2. Remove and add Debug / Run Configuration again.

Solutions details

1. Kill process that uses debug port

It is necessary to find PID of the process that wasn't stopped in correct way by IntelliJ and kill it manually from cmd level. As we can see from below screenshot the port taken is 50188 by some process.

Simple steps:

  1. to find PID of process that uses port 50188 run following command:
    netstat -ano | findstr :50188
  2. to kill process with PID 50188 run following command:
    taskkill /PID 6032 /F

Example console output:

Practical example how to kill Tomcat on windows from cmd level.
Practical example how to kill Tomcat on windows from cmd level.

After taskkill executiuon we can run our project in debug mode.

2. Remove and add Debug / Run Configuration again

The solution is to remove my_project configuration from Debug / Run Configurations and create new one.

Explanation: sometimes IntelliJ has same problems when we change configutaions of Tomcat that is used by some project.

Below screenshots show how to open Debug / Run Configurations window.

Instruction how to open Debug / Run Configuration windows in IntelliJ.
Instruction how to open Debug / Run Configuration windows in IntelliJ.
Debug / Run Configurations in IntelliJ with selected Add / Remove configuration buttons.
Debug / Run Configurations in IntelliJ with selected Add / Remove configuration buttons.
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join