How do you set the class path for groups of class files in nested directories?

K

keith edward

Hello,

I am working on a bunch of classes in the following directory
structure. There of course relationships between the class files:

/org/nis/acs/

The source files are in the same kind of directory structure.

When I compile a java file inthe source directory, it complains it
can't find a class that it needed in the classes directory. Do I have
to place every single class file (from /org/nis/acs) in the classpath?
If I just put the /or/nis/acs in the classpath it doesn't seem to
work... Ideas... I can get to work if I package everything, and then
put the package in the classpath, but then I have to constantly
re-package...

Thanks
keith
 
J

John C. Bollinger

keith said:
Hello,

I am working on a bunch of classes in the following directory
structure. There of course relationships between the class files:

/org/nis/acs/

The source files are in the same kind of directory structure.

When I compile a java file inthe source directory, it complains it
can't find a class that it needed in the classes directory. Do I have
to place every single class file (from /org/nis/acs) in the classpath?
If I just put the /or/nis/acs in the classpath it doesn't seem to
work... Ideas... I can get to work if I package everything, and then
put the package in the classpath, but then I have to constantly
re-package...

You compile from the superdirectory of org/ in your source tree, or put
that directory in your source path. You put the superdirectory of the
classes' org/ directory in the classpath (although you might not even
need to do that). This all assumes that the sources are organized into
packages that correspond to the directory structure. That's the Java
way. If you prefer some other way then you're on your own.


John Bollinger
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top