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,
- [Fix] Error 1020 Cloudflare: Access was denied
- What is an Authorization Code Grant? OAuth 2.0
- Fix: psql: error: connection to server at localhost (::1) port 5432 failed: FATAL: database does not exist
- 100+ SEO Tips to improve your website search ranking
- How to submit website to dmoz directory
- How to check the version of NodeJS installed
- How to enter Rockstar Activation Code?
- Background task activation is spurious error - Windows 10, Office 2016, Office 365
- Angular CLI ng Error: You need to specify a command before moving on. Use --help to view the available commands
- cURL HTTP GET request command examples
- Fix - JioCinema Something Went Wrong Please Try Again Error 8001 while streaming IPL Cricket Live
- How to remove password from pdf file
- How to identify the version of IntelliJ
- Command: How to scp a file to remote server location?
- How to add Widgets to MacBook Desktop
- Setting up RSS feeds notifications within Outlook
- Fix - Website Connection timed out Error Code 522 (Cloudflare)
- How to fix: Please check your network connection (Retry)
- Fix: Could not connect to Redis at 127.0.0.1:6379: Connection refused
- Accept Only 0-9 Numbers RegEx Example
- How to create a New Project in Visual Studio Code (VS Code)
- Top 10 emerging breakthrough trending technologies
- Free Unlimited Calls from MTNL & BSNL Landlines from 1st May 2015
- [Error] zsh: command not found: mvn
- How to Scan iPhone for Virus? Is Antivirus it really required?
More Posts:
- Fix: Microsoft OneDrive We are currently experiencing technical difficulties - Microsoft
- Error running 'app': No target device found. - Android-Studio
- How to turn off 5G Network on iPhone - iOS
- Jupyter: Safari Cant Connect to the Server localhost:8888/tree - Python
- Fix Microsoft Office 365 error code 135011 - Your organization has disabled this device - Microsoft
- Open .bash_profile File in TextEdit using Terminal - MacOS
- Run Scripting Language (JavaScript, Python, Groovy, Ruby) in Java - Java
- [git] fatal: clean.requireForce defaults to true nor -f given; refusing to clean - Git