Mac OSX – What program is using port 8080

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.

References

  1. Wikipedia : Lsof
  2. Wikipedia : PS in Unix
  3. Linux – Which application is using port 8080

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
HelenLinux – Which application is using port 8080 Recent comment authors
newest oldest most voted
trackback
Linux – Which application is using port 8080

[…] Mac OSX – What program is using port 8080 […]

Helen
Guest
Helen

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 🙂

Featured Posts