Address already in use? Intellij

11,844

Solution 1

This happens because every time the code is ran using the green arrow icon it generates a new instance and since the port (8080 in this case) is already in use it can't run again.

The first solution comes stopping the instance is currently in use, you can know if there is already an instance running at the bottom left corner tabs, if one of the tabs has a little green dot it means it is currently running.

Green Dot

One nice feature to avoid this is to go the run/debug configuration and set the option Single Instance Only at the top right corner as you can see here:

Single Instance Only Screenshot

Now, you can run the project using only the green arrow/bug icons and it will stop it if it's already running, compile and then run again just with one click.

I found this very helpful to get rid of this silly error.

Solution 2

Another option is Go to Run-->Edit Configuration --> Startup/Connection tab

Select Debug and change the port beside Debugger Settings..

Share:
11,844
Gemasoft
Author by

Gemasoft

DE DÍA: Application Development Manager @O'Reilly con experiencia en Google Cloud Platform, mayormente en App Engine y Datastore, con varios años de experiencia en VB, C#, .NET MVC, Java, Spring MVC, Hibernate, Angular, NodeJs, MSSQL, MySQL y PostgreSQL, también algo de Android. DE NOCHE: Desarrollador de Juegos indie en Unity con C#, Hardcore Gamer y Creador de Contenido con +190k followers en @Facebook, aficionado de las desveladas y alérgico a los perros.

Updated on June 14, 2022

Comments

  • Gemasoft
    Gemasoft almost 2 years

    Sometimes when I try to run my project using maven mvn clean install jetty:run it returns an error that says: "Address already in use".

    I'm using Intellij IDEA 14.

    Could you please help me to figure out what's happening?