Originally posted by Nedyalka Gunderson:
I have two packages, each package is dependent on the other. (Package A uses classes from package B. And package B uses classes from package A.) How can I compile each package, so they see the other dependent package? My compiler says it cannot resolve symbols since it cannot find the compiled packages.
I am using JCreator as my development environment. I don't know how to arrange the packages in directories to resolve these dependencies. Does JCreator require the .java files stored in a particular directory structure? Even classes within the same package can't see each other and I can't compile them.
Until you completely understand how directories, packages and classpath are related,
you should stay away from IDEs. They hide the real world, make complex problems too simple and simple problems too complex. Use a programmer's editor such as jEdit or TextPad and use
Ant to build your project.
For those who will say that I hate
IDE's because I've never used one, you are wrong. I've used NetBeans, Forte, Visual Cafe, Borland JBuilder, Oracle JCreator, Visual Studio.Net, VB5, VB6, VC++5, VC++6. These things are like power tools, its easier to cut square corners with a nice Makita compond mitre saw, but its also easier to lose a finger if you don't understand how it works..
What you need to do is build a directory structure from your classpath, eg. if classpath = C:\javadev\SCJD\classes, then you need a directory structure like:
C:\javadev\SCJD
C:\javadev\SCJD\classes\suncertify
C:\javadev\SCJD\classes\suncertify\db
C:\javadev\SCJD\classes\suncertify\gui
C:\javadev\SCJD\code\suncertify
C:\javadev\SCJD\code\suncertify\db
C:\javadev\SCJD\code\suncertify\gui
You put the code in the code subdirectories and ask your IDE to build the classes in the classes subdirectories. You then use the jar tool to build a jar file based on the classes.