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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:08:20+00:00 2026-06-02T13:08:20+00:00

I have written a code in java. In which I have created a package

  • 0

I have written a code in java. In which I have created a package called xml-creator.
Package xml_creator has 3 classes say XML_Control, XML_Creator, and XML_implement.

When I run my project on netbeans (NetBeans 7.0) it works fine. But if I try to compile code on console, I get various errors like

When I compiled XML_Creator.java, I get following errors.

XML_Creator.java:371: cannot find symbol
symbol  : variable XML_implement
location: class xml_creator.XML_Creator
                    typeAttr.setValue(XML_implement.table_col[i][2]);
                                      ^
XML_Creator.java:375: cannot find symbol
symbol  : variable XML_implement
location: class xml_creator.XML_Creator
                for(int j=0;j<XML_implement.kTab;j++)
                              ^

XML_Creator and XML_implemenr both are in same package but non of them extend each other.

I am sorry I cant show code on this site as it is too large and aginst the company’s policies.

I dont understand why it is showing me errors?

Sample code
XML_Control.java

package xml_creator;
public class XML_Control 
{
    public static void main(String as[])
    {
        XML_Creator xml = new XML_Creator();    
    }
}

XML_Creator.java

package xml-creator;

public class XML_Creator
{
    XML_implement ixml = new XML_implement();
    public XML_Creator() 
    {
        System.out.println(""+ixml.a);
    }
}

XML_implement.java

package xml_creator;
public class XML_implement 
{
    public int a;
    public XML_implement()
    {
        a = 10;
    }
}

So when I compile XML_Creator.java, console gives 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-06-02T13:08:22+00:00Added an answer on June 2, 2026 at 1:08 pm

    It sounds like you’re compiling within the directory containing the .java file, and only telling the compiler about one of the source files. That’s the problem – to try to find a source or class file, the compiler is using the package name, and expecting the packages to be laid out in the conventional fashion. Compile from the root of the source tree – which I certainly hope you’re using – like this:

    javac xml_creator/*.java
    

    You may also want to specify an output directory – which again will be the root of the directory hierarchy for packages:

    javac -d bin xml_creator/*.java
    

    If you’re building regularly from the command-line (and not just for throwaway code) you should look into using a build system such as Ant.

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

Sidebar

Related Questions

Let's assume I have a framework written in Java and some C++ code which
I have these two snippets of code (written in Java) which is more more
I have written a piece of Java code which I am suppose to expose
I have written code in Java to access web cam,and to save image... I
I have written java code for generating json of my searched data from file.But
In our application, I have seen code written like this: User.java (User entity) public
I have an in-house HTTP server written in Java; full source code at my
JAVA Code Here is some part of my code that I have written in
I have written a server is java here is the code: public mainClass() {
I have written a java socket server program which listens to a port continuously.

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.