If you’re a developer working on a Mac, you may encounter the “Port 8080 already in use” error when trying to start a Java web server or some other application that listens on that port. This error typically means that another application or service is already using port 8080, which prevents your application from starting.
In this article, we’ll show you how to use the sudo kill -9 command to terminate the process using port 8080, freeing up the port for your application to use.
The first step in resolving the “Port 8080 already in use” error is to identify the process that’s currently using the port. To do this, open a terminal window and run the following command:
lsof -i :8080
This command will list all the processes using port 8080. You should see something like this:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 12345 user 42u IPv6 0xa1b2c3d4e5f67890 0t0 TCP *:http-alt (LISTEN)
In this example, the process using port 8080 is a Java process with the PID (process ID) of 12345.
Now that you’ve identified the process using port 8080, you can terminate it using the sudo kill -9 command. This command sends a SIGKILL signal to the specified process, forcing it to terminate immediately.
To terminate the process, run the following command in your terminal:
sudo kill -9 12345
Replace 12345 with the PID of the process you identified in step 1.
After running this command, the process using port 8080 should be terminated, freeing up the port for your application to use.
Now that you’ve freed up port 8080, you can try starting your Java web server or application again. It should now start successfully without encountering the “Port 8080 already in use” error.
To fix a port already in use, you can either kill the process running on that port or change your app to use a different port. Using the lsof command to find the process id and then the kill command is a common method to resolve such conflicts.
To fix a port already in use, you can either kill the process running on that port or change your app to use a different port. Using the lsof command to find the process id and then the kill command is a common method to resolve such conflicts.
macOS: Open Terminal: Navigate to the Applications/Utilities folder or use Spotlight Search to find it. In the Terminal, enter the following command: lsof -i :8080 .
Step 1: Identify the process using port 8080. The first step in resolving the “Port 8080 already in use” error is to identify the process that's currently using the port. ...
Step 2: Terminate the process using sudo kill -9. ...
You need to access your app with http in the URL not https when developing locally. You may have your web browser set to automatically try to upgrade the connection from http to https. If you, disable this setting.
You can find what ports are open on an OS X version of Mac fairly easily by doing the following: STEP 1: Open “Network Utility,” located in the “Utilities” folder in the “Applications” folder, and click “Port Scan.”STEP 2: Type your IP address, and then click the “Scan” button.
The Error “address already in use” occurred because some process was already running on the same port. So we can resolve the issue just by killing the process. To stop the process, we need the process ID (PID), which we can fetch using the lsof command.
Port 8080 is commonly used as a proxy and caching port. It is also above the service port range. Port 8080 also can run a Web server as a non-root user. Other assignments for port 8080 include Apache Tomcat, an M2MLogger, and a Web GUI.
Click the "Firewall Options" button. Click the "+" button to add a new rule. Select "Allow incoming connections" for the new rule. Choose "Applications" to specify the application or "Port" to specify a port number.
Step 1: Find the Process ID (PID) sudo lsof -i :portNumber. Replace portNumber with the actual port number. Copy the PID number.
Step 2: Kill the Process. kill PID. Replace PID with the copied process ID. If necessary, try kill -9 PID or sudo kill -9 PID for forceful termination.
Expand the Network Tab.Move to the section for Listening Ports.Look in the Port column and scroll to find entry for port 8080.Select the given process and delete/kill the process.
Find the process ID (PID) of the port (replace the 'portNumber' with the number) netstat -ano | findstr :portNumber. Copy the PID number for the next step.
Kill the process. First, try this (replace typeyourPIDhere with the number you copied above): taskkill /PID typeyourPIDhere /F.
Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.
We notice you're using an ad blocker
Without advertising income, we can't keep making this site awesome for you.