: Address already in use: JVM_Bind

import java.io.DataOutputStream;
import java.io.IOException; 
import java.net.ServerSocket;
import java.net.Socket; 


 public class serverNew { 

     public static void main(String[] args) {
         try { 
             ServerSocket server = new ServerSocket(3001);
             Socket client = server.accept(); 
             DataOutputStream os = new DataOutputStream(client.getOutputStream()); 
             os.writeBytes("Hello Sockets\n"); client.close();
         } 
         catch (IOException e) {
            e.printStackTrace(); 
         }

         System.out.println("done???");
     }
 }

While I was running the above code ,i got following error

error given Can I have some sort of help ???

Upvotes: 0

Views: 433

Answers (1)

found the error by myself with the help of Fast Snail>>>

need to change the port , it was that much easy.

Upvotes: 1

Related Questions