Accepted answer

you've another instance of tomcat already running. you can confirm this by going to http://localhost:8080 in your webbrowser and check if you get the tomcat default home page or a tomcat-specific 404 error page. both are equally valid evidence that tomcat runs fine; if it didn't, then you would have gotten a browser specific http connection timeout error message.

you need to shutdown it. go to /bin subfolder of the tomcat installation folder and execute the shutdown.bat (windows) or (unix) script. if in vain, close eclipse and then open the task manager and kill all java and/or javaw processes.

or if you actually installed it as a windows service for some reason (this is namely intented for production and is unhelpful when you're just developing), open the services manager (start > run > services.msc) and stop the tomcat service. if necessary, uninstall the windows service altogether. for development, just the zip file is sufficient.

or if your actual intent is to run two instances of tomcat simultaneously, then you have to configure the second instance to listen on different ports. consult the tomcat documentation for more detail.


refer to the following blog "how to kill tomcat without have to restart your computer"

hope this will help someone in the future.


on eclipse make a raw delete of tomcat configuration folder under project "servers". i tried it as last hope and it worked.


in case of windows, i experienced a new stuff... stopping tomcat from /bin folder will immediately not releasing the port 8080. it takes around 5-10 mins to release the port. after 10 mins again if i try to run my project run-> run on server .. it allows to run.

i'm unsure whether my understanding is correct!


several ports (8005, 8080, 8009) required by tomcat vx.x server at localhost are already in use

to check whether another instance of tomcat already running or some other process is using the ports you can use:

netstat -b -a in command prompt for windows. this lists the ports in use and gives you the executable that's using each one. you need to be in the admin group to do this.

you might get something like this:

tcp listening 196 [tomcat7.exe]

tcp listening 196 [tomcat7.exe]

tcp listening 196 [tomcat7.exe]

open task manager ctrl+shift+esc, and kill tomcat7.exe or any other process using these ports.


it occurs when others in the project are also using the same port numbers as you are using! double click tomcat server, change port numbers to anything 8585 or whatever. the code will now begin to run!


how to kill a windows service using pid -

  1. open command prompt and type netstat -ano
  2. find the pid of the ports which are in used, in this case, it will be 8080, 8005,8009. let's say pid of these ports are 5760.
  3. now type taskkill /f /pid 5760
  4. it will close the pid and ports will be available for use. now you can start tomcat as normal by windows services or by eclipse itself.


kill a windows service that's stuck on stopping or starting


your tomcat is probably running already. that's why you have got an error. i've had the same problem before. i solved it very simply:

  1. restart your computer
  2. open eclipse
  3. run your tomcat

that's all.


in windows os do right click on task bar-->start task manager-->process then check java.exe or javaw is running if it is running,then click on it and do end process then restart your tom cat server.

  1. some times skype will occupy port 80 in that case change the skype settings and put 81 for skype or change tomcat configuration.


don't need to close your eclipse ide.your tomcat is probably running already. that's why you have got an error.

open tomcat directory >> bin >> from command terminal (in my case is tomcat9)

enter command


it will close your running tomcat

enter image description here


easiest solution

single line command for killing multiple ports:

kill $(lsof -t -i:8005,8080,8009) 

8005, 8080 and 8009 are the ports to be freed.

alternatively, you can try sudo kill sudo lsof -t -i:8005 in linux.


all of above do not work for me.

what i found was click the details button. enter image description here

then following the multiple contexts with the same path error running web service in eclipse using tomcat

removed the duplicated line then i got an another error.

the server cannot be started because one or more of the ports are invalid. open the server editor and correct the invalid ports.

following can't start tomcatv9.0 in eclipse

then it works.


macbook solution:

step 1: stop the server running java :

open activity monitor by going to applications > utilities > activity monitor. or simple press cmd + spacebar and start typing activity monitor. look for process running java and kill it by giving the following command in terminal

kill -stop <pid> 

where pid is the process id of the java process as displayed in the activity monitor. do it a couple of times and close and reopen activity monitor to check java isn't running.

step 2: change the port :

right-click on the server in eclipse and click 'open'. change port number from 8080 to 8081 or something greater in value.

this should hopefully start your server.


the simpler fix that works for me is deleting my current deployed webapps from tomcat through the "server" tab. once i remove them the problem goes away. simply re-deploy your project by going on run as > run on server.


the problem often arises when apache tomcat fails to terminate, properly, even though a shutdown instruction was sent. in my case, using tomcat 8, this happens with annoying regularity. luckily, you can use windows powershell and the netstat command to create a simple script to kill the process.

the following powershell script will parse the output from netstat to find any process that is listening on, extract its pid and then kill that process:

netstat -a -o -n `
 | select -skip 4 `
 | % {$a = $_ -split ' {3,}'; new-object 'psobject' -property @{original=$_;fields=$a}} `
 | ? {$_.fields[1] -match '127\.0\.0\.1\:8005$'} `
 | % {write-host "killing pid" $_.fields[4] "..."; taskkill /f /pid $_.fields[4] }

if your server.xml configures tomcat to use a different port or ip, edit the regular expression on the script's fourth line accordingly.

finally, i should point out that the situation is better on linux because you can instruct tomcat to save its pid to a file at startup-time and use a switch to force the shutdown, later - the shutdown script for 'nix systems already features the ability to kill the process and the sleuth-work with netstat is not required.


if the above issue occurs in windows 7 or 10 based os, the problem occurs because tomcat is running as windows service. to stop tomcat running as windows services, open windows control panel. find the service "apache tomcat" and stop it. the another way is to kill the process running on port 8080 using cmd.

open cmd running it as administrator.

  1. c:\users\username>netstat -o -n -a|findstr 0.0:8080
  2. tcp listening 2160.
  3. the above 2160 is process id of process running on port 8080 and kill that process using the following command
    c:\users\username>taskkill /f /pid 2160
  4. go to ide and start server, it will run


it may be because you are not stopping your tomcat service properly. to do that, open your task manager there you can see a javaw.exe service. first stop that service. now restart your tomcat it works fine.


in my case, it was giving me the error: port 8005 required by tomcat v8.0 server at localhost is already in use

i changed 8005 port in apache-tomcat-8.0.39\conf\server.xml but changes were not getting reflected. then i did these changes from eclipse. by double clicking server and modifying the port from 8005 to 8006 and it works. enter image description here

before putting 8006 i checked in windows shell if this port is available or not. by executing following command:

netstat -a -o -n | findstr 8006


i face the same problem and after searching the answer as shown below: 1. open monitor tomcat as shown below: enter image description here

  1. simply press stop as shown in below picure:

enter image description here

finally it works with me after many trials and suggested solutions.

best regards, kerelos mikhail


if you are in java ee prospective in eclipse and trying to start the tomcat server in eclipse in debug mode, then you will get such errors. you must switch to debug prospective in eclipse. i have solved my problem like this.


sometimes if the ports are not freed even after attempting shutdown.bat what @balusc suggested,you can kill the javaw process. do following steps :

  1. click on start menu and open "windows powershell"
  2. right click before opening and select "run as administrator"
  3. enter command ps. you may see a image as follows : powershell showing current proesses running

  4. see the process number of process "javaw".the process number is the rightmost number in the columns, i have highlighted in the image process number of javaw for example.

  5. enter command kill . javaw is killed and now you must be able to run the program.


here's one more option to try if none of the efforts above helped. you might be using eclipse from a shared drive (for eg, h:). if so, move/copy it the entire eclipse directory to c: and try again.

my eclipse could not open ports for tomcat server (with the above error), nor even connect to internet. i also tried another tomcat plugin (sysdeo) which failed to open the ports too.

these are the options i tried:

check and kill other tomcat instances

  • in command prompt, netstat -ano and check if any other processes are using the conflicted ports.
  • find the pid and kill it
  • try starting the server again.

change tomcat ports in eclipse

  • in eclipse server tab, double click the tomcat instance. this will open the configuration tab.
  • under ports, change the port numbers. (for eg, 18080).

kill java.exe and javaw

see my other answer for eclipse not connecting to internet (


for windows users:

go to task manager directly with ctrl+shift+esc key combination.

kill the "java.exe" processes by right clicking and selecting "end task".


i checked all the answers but informing only to kill pid.

in case if you have terminal access shared by all it will not help or maybe you do not have permission to kill pid.

in this case what you can do is:

double click on server

go to overview and change ports in ports like this:

enter image description here


easy way to solve your problem:

the server may already be running in another process, or a system process may be using the port. in order to kill that port, do the following:

1) download tcpview(only 285kb) from following link.

2) extract folder and start tcpview application.

3) right click on java.exe(because 8009,8005 ports are commonly used by java process) and select end process option.

this would stop another process easily..

note: running tomcatpath/bin/shutdown.bat may not shutdown tomcat when it contains some demon or unmanaged threads. in such cases tcpview works fine without any issues.


on windows use command for stopping the already running tomcat instance and try running it again in eclipse, it may work.

net stop tomcat7 

or you can change the port in server's xml if you just want to run on some other ports.


what i did after reading all the suggested answer and as i know my port was already in use. i double clicked on tomcat under the servers tab in eclipse and it opened overview information and then find port information. just changed conflicting port as mine was 8009 port (error mentioned during starting the server). i have changed it to 8008 and it works fine. give a try if the changed port would not be in use server will start.


step 1: netstat -a -o -n and it will bring up a network list,search for the local address like and note the pid (eq 3624)

c:\>netstat -a -o -n

step2 : taskkill /f /pid 3624 . run this command to kill that process.

c:\>taskkill /f /pid 3624

link to post


i have no another instance of tomcat running ad no other process using "tomcat port" (in my case, the 8088 port). eclipse send the same message on starting tomcat:

....the server may already be running in another process, or a system process may be using the port. to start this server you will need to stop the other process or change the port number(s).

i solve the problem in this way:

  • go to bin of tomcat by prompt
  • launch startup.bat
  • launch shutdown.bat
  • start tomcat by eclipse


if eclipse says

several ports (8005, 8080, 8009) required by tomcat v6.0 server at localhost are already in use

this error comes because tomcat may be running in background so first stop that server..follow the below details.

solution is:

  1. open the "console" view (window->show view->console)
  2. then stop the tomcat server.
  3. then open the "server" view and start the server it will work.



if you use eclipse then double click on servers and double click on tomcat server then one file will open. in that file change http port to some other port number and save(ctrl+s) then again start the server.


steps to free port which is already used to run tomcat server in eclipse

for example , suppose 8080 port is used , we need to make free 8080 to run tomcat

step 1:

c:\users\username>netstat -o -n -a | findstr 0.0:8080

tcp listening 3116

now , we can see that listening port is 3116 for 8080 ,

we need to kill 3116 now

step 2:-

c:\users\username>taskkill /f /pid 3116

step 3: go to eclipse and start server , it will run


if you are on mac environment, here is what i did.

find the process id running on this port from terminal, eg, 8080:

lsof -i :8080

and kill it:

kill -9 <pid>  


you may see following result:

macsys:bin krunal.$ lsof -i :8080

command   pid     user   fd   type     device  size/off   node  name
java     21347   krunal  52u  ipv6      xxx      0t0      tcp  *:http-xxx (listen)

and kill it: (kill -9 21347)


if you are running on windows try this in the command line prompt:

netstat -ano

this will show all ports in use and the process id pid # of the process that is using that port. then ctrl+alt+del and open task manager to see which process is that.

you can then choose either to close/stop it or configure your server to use another port. to check if the new choosen port (let's say 8010) is available do this:

netstat -ano | grep 8010

if it does not return any lines then you are fine.

to change the port go to the server view, open server.xml and change the port there. mine has this entry:

connector port="8010" protocol="ajp/1.3" redirectport="8443"


kill $(ps -aef | grep java | grep apache | awk '{print $2}')
  • no need to restart eclipse
  • if you get the above error, just enter this line in terminal
  • again start the tomcat in eclipse.
  • works only in linux based system ( ubuntu ..etc )

Related Query

More Query from same tag