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

  • SEARCH
  • Home
  • 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 1082133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:15:29+00:00 2026-05-16T22:15:29+00:00

I am running into this problem when trying to recompile a single class inside

  • 0

I am running into this problem when trying to recompile a single class inside a package.

Now this class uses global types and some of these global types reference it. So taking it out of the package really isn’t an option.

So when I try to compile it with javac alone, I get invalid symbol errors and netbeans shows it is trying to compile things like classespackage.globaltype. Basically it is searching for the global classes inside of the package. Is there anyway to stop it from doing that?

Here is the code:

Global

public class Global {
    example.Main main;
    public Global(example.Main m) {
        main = m;
    }
}

example.Main

package example;

public class Main {
    public static void main(String[] args) {
        Global g = new Global(new Main()); // COMPILE ERROR
    }
}
  • 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-05-16T22:15:29+00:00Added an answer on May 16, 2026 at 10:15 pm

    I get invalid symbol errors

    You probably meant “Cannot find symbol” errors? This can be caused by anything. Imported class which is not in the compiletime classpath, methods which does not exist, variables which are out of the scope. You really need to post the compilation errors to get more detailed answers.

    At least, this much sounds like that you didn’t specify the dependencies (the imported classes) in the compiletime classpath using the -cp or -classpath argument.

    Is there anyway to stop it from doing that?

    By listening to those errors and taking actions accordingly.


    Update as per the posted code example: the cause of the problem is that classes in the default package (i.e. classes without a package declaration) are invisible to classes inside a concrete package (i.e. classes with a package declaration). You need to put Global in a package. Then it’s visible (importable) to classes inside a package.

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

Sidebar

Related Questions

Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints
I've been running into this problem with Flex for nearly a year, and each
I am running into the same problem as in this question: How do you
I am running into this issue of releasing an already released object but can't
I have a coworker looking for this, and I don't recall ever running into
Running into a problem where on certain servers we get an error that the
I am currently running into a problem where an element is coming back from
I keep running across this loading image http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif which seems to have entered into
I'm running into an issue where I have a FileUpload control in an UpdatePanel.
I'm running into a mental roadblock here and I'm hoping that I'm missing something

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.