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…
More Posts related to HowTos,
- Background task activation is spurious error - Windows 10, Office 2016, Office 365
- How to Generate Self-Signed OpenSSL certificate in three easy steps
- How to Kill service running on port using terminal command
- How to press shortcut CTRL + ALT + DEL on Windows Remote Desktop
- Top 10 emerging breakthrough trending technologies
- Free Unlimited Calls from MTNL & BSNL Landlines from 1st May 2015
- Setting up RSS feeds notifications within Outlook
- Static IP MTNL available at Rs. 200 per month
- CentOS Cannot find a valid baseurl for repo base7x86_64 yum
- How to write hello world different languages syntax
- BSNL Broadband upgrades speed to minimum 2MBps for all users 512Kbps 1Mbps
- [IRCTC] Indian railways official eRail API 1.1 for developers to get train info
- How to submit website to dmoz directory
- Gmail Unable to upload because it is a folder or a package (like an application bundle or RTFD document)
- How to use HashTags # correctly on Social Media Facebook Twitter
- Copy all .vcf Mobile Contacts files into one .vcf
- How to Change or Set a new Password for your Wi-Fi Router
More Posts:
- SharePoint Server 2016 IT Preview Deprecated Removed features - SharePoint
- How to make jsfiddle bootstrap ready - CSS
- How to enable line numbers in Eclipse - Eclipse
- Parsing Data for android-21 failed unsupported major.minor version 51.0 - Android
- SDK Manager: failed to install : Android Studio on Windows - Android-Studio
- Remove ActionBar from Activity that extends appcompat-v7 - Android
- Loading previous page using html button using JavaScript - JavaScript
- Tutorial : Simple Lightweight Pure CSS based Vertical Navigation Menu - CSS
- Calculate Area and Circumference of Circle - C-Program
- Gmail Error Bad Request Your client has issued a malformed or illegal request - Google
- How to Apply Themes to Notepad++ - NotepadPlusPlus
- [Solved] SharePoint Access Denied error editing Document Name - SharePoint
- Calculate Volume of Cube - C-Program
- The service instance "Microsoft SharePoint Insights" could not be provisioned because of the following error: Authentication information for SPInsights service has not been set yet - SharePoint
- Use Netbeans keyboard shortcuts in Android Studio - Android-Studio