By default, most Java web application servers are listening on port 8080, and it can easily cause the popular 8080 port conflict error. In Mac OSX, you can use sudo lsof -i :8080 | grep LISTEN to find out what program is listening on port 8080 :
In terminal
$ lsof -i :8080 | grep LISTEN
java 42975 mkyong 57u IPv6 0xf10ca37d995a077f 0t0 TCP *:http-alt (LISTEN)
The name “java” doesn’t tell you anything, to get the detail, ps the java PID 12895 like this :
$ ps -ef 42975
UID PID PPID C STIME TTY TIME CMD
501 42975 42960 0 12:41PM ?? 0:29.84 /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java
-Dcatalina.base=/Users/mkyong/Documents/workspace-new/.metadata/.plugins/org.eclipse.wst.server.core/tmp1
-Dcatalina.home=/Users/mkyong/apache-tomcat-8.0.28
-Dwtp.deploy=/Users/mkyong/Documents/workspace-new/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps
-Djava.endorsed.dirs=/Users/mkyong/apache-tomcat-8.0.28/endorsed
-Dfile.encoding=UTF-8 -classpath /Users/mkyong/apache-tomcat-8.0.28/bin/bootstrap.jar:
/Users/mkyong/apache-tomcat-8.0.28/bin/tomcat-juli.jar:
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/lib/tools.jar
org.apache.catalina.startup.Bootstrap start
The Eclipse IDE is using the port 8080.
how can we stop this port being used ? I mean what command line should I use in the terminal of mac
Hey, nice post. Thank you very much 🙂
Just a suggestion.
You wrote down “The name “java” doesn’t tell you anything, to get the detail, ps the java PID 12895 like this :”
Maybe you want to write “ps the java PID 42975 like this :”
Hope it helps. Thanks 🙂