Solved: Intellij Spring boot Gradle Error - Web server failed to start. Port 8080 was already in use
Solved: Intellij Spring boot Gradle Error - Web server failed to start. Port 8080 was already in use.
Have you ever encountered the below error in a Spring boot Gradle app on your WINDOWS machine with IntelliJ IDEA?
WEB SERVER FAILED TO START PORT **** WAS ALREADY IN USE
There could be a couple of solutions that you can try.
Solution 1: Find and Kill the process consuming the port
-
Find a process consuming the port
Use the below command in the WINDOWS command prompt using ADMINISTRATOR or WINDOWS PowerShell using ADMINISTRATORnetstat -a -n -p tcp -o | findstr 49415
The result of the above command could be eitherNO RECORDS
orTCP 192.168.1.32:49415 52.226.139.180:443 ESTABLISHED 7536
Note down the Process ID - last digits7536
in our case. -
Kill the process
In order to kill the process using the below commandkill --pid--
that iskill 7536
Solution 2: Check the JDK version
If the Java SDK version is not your application supports then you can get such an error.
-
Find the Java SDK version of the project in IntelliJ IDEA
In order to find the Java SDK version set for the project in IntelliJ IDEA editor, on a Windows machine- Click File
- Click on Project Structure
- On the left panel, under Project Settings, Click on the Project menu
- Find the option of SDK set for the current project.
- Edit the Java SDK for the project in IntelliJ IDEA
Once you find the SDK option as per the above steps, Select OR edit the SDK version of lower OR higher, and click OK.
Depending on the project you may need to set the SDK to the latest version or older version. Setting SDK to 1.8 should work in the most cases