Tomcat default port 8080 is occupied solution


Preface

In the process of using idea to develop Java Web, after deploying Tomcat, port 8080 is often occupied. I have searched a lot of solutions on the Internet, such as modifying the default port number to solve the problem of port 8080 being occupied. In the idea, I modified the port 8080 and running the jsp file still showed the occupation. Later , I closed the process occupying the port 8080 through the DOS window + task manager, and recorded it here. If you encounter this situation in the future, you will know how to solve it.


Tip: The following is the main content of this article: Solve the problem of port 8080 being occupied by DOS window + task manager

1. Solutions

When the server shows that port 8080 is occupied, there must be a process occupying port 8080. Use the DOS window to find the process occupying port 8080, and then use the task manager to end the process.

DOS window: find the process number occupying the port.
Task manager: find this Close the process after the process number

Note: Although this method can solve the problem of port occupation, it is best not to close the process that is not clear about the function , otherwise it may bring serious consequences


Second, the solution steps

1. Open the cmd administrator window

Press win+r to quickly launch the command window, enter cmd to open the administrator interface
Insert picture description here

2. Enter the command to view the port number and process number

Enter the netstat -ao command to display the port number and corresponding process number of this computer
Insert picture description here

3. Close the process through the task manager

You can open the task manager by pressing Ctrl + Alt + delete, or you can open the task manager by right-clicking on the taskbar with the mouse

Insert picture description here
Tomcat can run normally in idea or Eclipse after closing the process
Insert picture description here


to sum up

The above is how to solve Tomcat's default 8080 port being occupied by DOS window + task manager. Here is a learning record. If you forget the DOS window command or how to solve it, then look back and see how to solve it.

Guess you like

Origin blog.csdn.net/qq_48455576/article/details/113814276