mac logo

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

2 comments on “Mac OSX – What program is using port 8080

  1. 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 ๐Ÿ™‚

Leave a Comment

Your email address will not be published. Required fields are marked *