0

I got this error after running my client in java.

run:

Oct 01, 2017 8:08:07 AM from_sever.From_sever main
SEVERE: null
java.net.BindException: Address already in use: JVM_Bind
    at java.net.DualStackPlainSocketImpl.bind0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
    at java.net.ServerSocket.bind(ServerSocket.java:375)
    at java.net.ServerSocket.<init>(ServerSocket.java:237)
    at java.net.ServerSocket.<init>(ServerSocket.java:128)
    at from_sever.From_sever.main(From_sever.java:26)
2
  • Some other program is already using the port. Stop the other program, or use a different port. Commented Oct 1, 2017 at 2:20
  • You got this error running your server. Read the stack trace. You haven't run your client at all yet, or at least if you have you should not have. Commented Oct 1, 2017 at 6:40

2 Answers 2

1

Some other program already use that port.

You can check port usages by netstat -a. Look for your port number.

Sign up to request clarification or add additional context in comments.

Comments

1

Either change the port of your current program or just find out the already running application and kill it. Run below command in windows:-

netstat -ano | find <port_no_already_in_use>

taskkill /F /PID <process_id_running_on_port>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.