If you want to use a certain port to run some application on your Unix/Linux based system such as macOS but you get "Address/Port already in use" error and you don't have access to stop the service then you can kill this process as follows,
- Open Terminal.
- Run the command with the port used : example : lsof -i : <port_number>.
- You will get an output with ProcessID - PID if some process is running on it..
- Now kill the process by running the following command : kill -9 <PID> (example : kill -9 4133)..
- Now try to run the server you would not get BindException exception..
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 4133 code2care 13u IPv6 0x335aaef2sdf 0t0 TCP *:a39c892 (LISTEN)
To know which services are running on which port you can do a port scan on a Mac device as follows:
- Open Network Utility (using Spotlight Search)
- Go to Post Scan tab
- If the services are running on localhost Enter IP as localhost or 127.0.0.1
- You can run the test for all ports or certain range say 80 to 10000
Port Scan has started… Port Scanning host: 127.0.0.1 Open TCP Port: 80 http Open TCP Port: 88 kerberos Open TCP Port: 443 https Open TCP Port: 631 ipp Open TCP Port: 3306 mysql Port Scan has completed…
- Top 10 emerging breakthrough trending technologies
- How to Change or Set a new Password for your Wi-Fi Router
- How to Generate Self-Signed OpenSSL certificate in three easy steps
- Setting up RSS feeds notifications within Outlook
- How to fix: Please check your network connection (Retry)
- How to replace &nbsp; with space
- Merge multiple zip files without unzipping (extracting)
- Free Unlimited Calls from MTNL & BSNL Landlines from 1st May 2015
- Static IP MTNL available at Rs. 200 per month
- Copy all .vcf Mobile Contacts files into one .vcf
- Fetch More then 10 Links Per Page in Google Search Result - Google
- Android Studio: Cannot perform refactoring operation - Android-Studio
- eclipse maven m2e : Cannot complete the install - Eclipse
- Top 3 Awesome Text Editors developers prefer at workplace - Sublime
- Calculate Area of a Rectangle - C-Program
- What is Bootstrap Jumbotron and how to use it - Bootstrap
- Background task activation is spurious error - Windows 10, Office 2016, Office 365 - HowTos
- How to remove old 404 pages ulrs from Google crawler - Html
- Exception in thread main java.lang.NoClassDefFoundError: package javaClass - Java
- SharePoint Server 2016 error Microsoft Office Online Server 2016 cant be installed on the same machine as a Microsoft SharePoint Server product - SharePoint
- 7 deadly java.lang.OutOfMemoryError in Java Programming - Java
- Unable to establish connection to adb : Android Studio Error - Android
- How to send WhatsApp message from your Android App using Intent - WhatsApp
- Portable Notepad++ for windows - NotepadPlusPlus