Launching Spring application Address already in use
Run the following command to search for the process that is using the port
lsof -i :<portNumber> | grep LISTEN
in your case this will be -->
lsof -i :8080 | grep LISTEN
java 78960 xyxss 119u IPv6 0x6c20d372bc88c27d 0t0 TCP *:8092 (LISTEN)
The 78960 is the process id, use the following command to kill the process
kill -9 78960
Launch the application again.
You need to stop the server before re-launching. Look for the red box icon or server view.
Spring Boot uses embedded Tomcat by default, but it handles it differently without using tomcat-maven-plugin
. To change the port use --server.port
parameter for example:
java -jar target/gs-serving-web-content-0.1.0.jar --server.port=8181
Update. Alternatively put server.port=8181
into application.properties
(or application.yml
).
Configure another port number(eg:8181) in /src/main/resources/application.properties
server.port=8181