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 8759337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:46:37+00:00 2026-06-13T14:46:37+00:00

My program consists of classes that extend other classes. The problem is, when I

  • 0

My program consists of classes that extend other classes. The problem is, when I try to compile them in cmd, system says “Cannot find symbol”. Some sites discussing similar problems mention including the source folder in the CLASSPATH. I did as they said and it still gives the same error. However, it runs smoothly in Eclipse. Any ideas why?

  • 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-13T14:46:39+00:00Added an answer on June 13, 2026 at 2:46 pm

    Make sure that you compile the top level class first. If you try to compile a class extending other class, and you don’t have compiled .class file for that class, you will get that error.

    package pkg1;
    class A { }
    
    package pkg2;
    import pkg1.A;
    class B extends A { }
    

    For the above code, you should compile the .java file containing your class A first to get your .java file containing class B compiled. Also, set the path containing your class files in your classpath.

    In Eclipse, it works because it automatically compiles your classes as you save them.

    NOTE: –

    If you are having your classes under some packages, then compile your java files using this command: – javac -d . A.java. This will create a folder for the package name and put the class file in that folder automatically. Then your class B would be able to find it

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

Sidebar

Related Questions

i am writing a program in bluej which consists of several classes that get
Suppose I have a big program that consists of hundreds of methods in it.
I have a homework problem where I have to make an inheritance program that
My program consists of a large graphing UI control that I need to spend
My program consists of a simple gui and a class that extends thread! i
When you're writing a program that consists of a small bit of main logic
I have to develop one program that consists data manipulation (retrieve data, update data
THIS IS HOMEWORK: I have a program that consists of two winforms and three
I am maintaining a program with customer informations. It consists of many forms that
I am writing a simulation program that proceeds in discrete steps. The simulation consists

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.