How Do I Run a Client Server Program in Windows?

How Do I Run a Client Server Program in Windows?
Contents

How do I run a client program from the command prompt?

3 Answers

  1. make a new folder named program (it’s your package name)
  2. put the Server.java and Client.java into program.
  3. open the CMD and cd to root path.
  4. execute: javac program/Server.java (maybe programServer.java on windows)
  5. execute: java program.Server.

1 дек. 2017 г.

How do I run a Java client server on Windows?

Creating Client:

  1. import java.io.*;
  2. import java.net.*;
  3. public class MyServer {
  4. public static void main(String[] args){
  5. try{
  6. ServerSocket ss=new ServerSocket(6666);
  7. Socket s=ss.accept();//establishes connection.
  8. DataInputStream dis=new DataInputStream(s.getInputStream());
Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.