• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strange Compiler behavior. HELP!!

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This may be an easy problem so any help will be appreciated, and thanks in advance.
I created a base class and then extended it in a child class. Everything was great (compiled and worked fine) until I created a package and put both classes in the package. Now the Base class still compiles but the child will not. It is throwing a compiler error on the class declareation.

public class nbn_GCOrderObject extends nbn_OrderObject {

the compiler error is as follows.....

---------javac--------
nbn_GCOrderObject.java:7: Cannot resolve symbol
symbol class nbn_OrderObject
location class nbn.nbn_GCOrderObject
class nbn_GCOrderObject extends nbn_OrderObject {
^
Why will it compile outside of the package but not inside it?? I have package statements at the top of both classes.
thanks,
Scott
SCJD
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It probably has to do with the CLASSPATH. The classes must now be in a directory which is the name of the package, and the CLASSPATH must include that directory. As is, when compiling the child class, the compiler can no longer find the compiled parent. This is not an issue when you have no explicit package.
 
reply
    Bookmark Topic Watch Topic
  • New Topic