Published on Sep 8 2011 in Java Tomcat

java.net.BindException: Address already in use:8080 is caused by more than 1 process using the port.

Please check how many java processes you are running. If more that one you may need to kill them and restart application server. The Force Restart function in Java Control Panel does it. You can also do it with command line.

[~]# ps x
    3410 ?        Sl     0:44 /usr/local/jdk1.5.0/bin/java -Djava.awt.headless=true
    7262 pts/15   Sl     1:22 /usr/local/jdk1.5.0/bin/java -Djava.awt.headless=true
[~]# killall -9 java
[~]# $CATALINA_HOME/bin/startup.sh

Alternatively - to first see what process is using the port - run:

[~]# netstat -tlnp | grep -e ':8080'
tcp        0      0 :::8080                    :::*                        LISTEN      74721/java

On a VPS or dedicated server the conflict can also be caused by a non-java process using the port. For example Apache webserver or Squid proxy it they are configured to use 8080. On shared servers we assign custom ports to users java processes and take care that port conflicts does not occur.