Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9030647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:32:33+00:00 2026-06-16T07:32:33+00:00

I am writing a basic TCP chat program and one of the requirements is

  • 0

I am writing a basic TCP chat program and one of the requirements is that it can be run from the command line with the following argument formats:

java Server 8888
java Client localhost 8888

Which will start a server listening on 8888 and which waits to accept incoming connections from clients. Then start a client and connect to the server at localhost:8888. These classes can both be compiled and run from within Eclipse and I have added the above variables to the run configurations for the classes, respectively.

If I navigate to the directory of the files in CMD I can see the compiled .class files, but when I try to run the server with:

java Server 8888

I get the error

Error: Could not find or load main class Server

Eclipse>Window>Preferences>Java>Compiler shows JDK 1.7.

Running java -version from the command line shows

java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)

I want to be able to run both the classes from separate prompts in parallel. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:32:34+00:00Added an answer on June 16, 2026 at 7:32 am
    java -cp . basicChat.Server 8888
    

    You need to specify the fully qualified class name (including the package name)

    Reason:

    The class full name (known as fully qualified name) is not Server, it is basicChat.Server. The file is located under a directory named basicChat. So java is looking for a a directory structure matching the package name.
    The Server.class file is located under the basicChat directory in the file system.

    Else consider how we would have a problem to select the intended class if you had several classes called Server in different packages (name spaces).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a basic war-driving program. I have gotten it to loop the command
I am writing a basic program in Python that prompts the user to enter
I'm writing a basic UNIX program that involves processes sending messages to each other.
I'm writing a basic chess program to calculate how many sets you can make
I am writing a basic file dump from one database to another. I am
I am writing a TCP connection based DLL. The basic premise is that it
Hey--I'm writing a basic Rails app that uses the digg API. I'm trying to
I need help writing a basic IRC bot that just connects to a channel..
When writing a basic c program. #include <stdio.h> main(){ printf(program); } Is the definition
I am writing a basic timer program with Java, and in the program I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.