Today, I used idea to run a git project. After configuring tomcat, I ran an error and found that the default port 8080 was occupied. The problem was solved by the following method.
Table of contents
1. Open the terminal (WIN+R or right-click the start menu and select 'Run')
2. Check the status of the occupied port
3. Kill the process that occupies the port
Solution:
1. Open the terminal (WIN+R or right-click the start menu and select 'Run')
Enter cmd and press Enter:
to enter the terminal
2. Check the status of the occupied port
Enter in the terminal: netstat –ano
After clicking Enter, find the process occupying port 8080 below
①Remember the corresponding PID here is 9784
3. Kill the process that occupies the port
Method 1: Task Manager→Details→Click on PID (sorting for easy search)→Find the process with PID 9784 →End the process
Method 2: Kill the process that occupies the port directly through the terminal
Query the name of the terminal process: enter tasklist | findstr 9784 in the terminal ( 9784 is the PID just found)
Kill the process named Tomcat8.8.exe:
Enter taskkill -f -t -im processname
Enter to kill the process
The above is the method to solve the port occupation problem under the Windows system.
Note: This is not a good solution to IDEA's port occupation problem (because the application that occupies the port queried above, we still need to be unable to close it, then we can choose to replace the port we start the project with) This article uses this example to demonstrate How to solve the problem of Windows system port occupation.