posted 21 years ago
When you compile the class B you need to specify where class A is located in the classpath. For instance, if you are in c:\level1\level2\level3 you compile class A
> javac A.java
And then to compile class B you need to enter the following:
> javac -classpath ..\..\..;%CLASSPATH% B.java
And everything should be fine.
The "..\..\.." refers to C:. So in B there should be an import statement for A like
import level1.level2.level3.A;
To find A, the compiler must have a clue where to find level1 first (which is C: )
[ March 29, 2002: Message edited by: Valentin Crettaz ]