Hi,
In case I try to import C in B, like import A.C.*;
it simply says package not found and does not compile. If i try it through the set method of the javac.exe it will also say: packe not found.
So is there any method how to import This package C in B, when C and B are subpackages of A
Message was edited by:
betlor
> Hi,
> In case I try to import C in B, like import
> A.C.*;
it simply says package not found and
> does not compile. If i try it through the set method
> of the javac.exe it will also say: packe not found.
>
> So is there any method how to import This package C
> in B, when C and B are subpackages of A
>
> Message was edited by:
> betlor
Yes, the way you're doing it. It's probably the way you're compiling. How are you compiling this, give details of the command, where you execute it from and the directory structure of your packages
Hi,
The whole code is saved in C:, just like the javac. exe:
C:\A\B
C:\A\C
call of the javac.exe:
C:\Sun\AppServer\jdk\bin\javac.exe -g -cp "C:\A\C" -sourcepath "C:\A\B"
Is there any method how to change the code so that it works without changing something in the javac?
> It still throws the same error: package not found. I guess in this case I
> have to reorganise my code.
I guess so too; always keep the directory structure where you store the
.class files identical to the directory structure where you store your .java
source files. Make the classpath point to the root directory where you
store the .class files and everything will be fine. Optionally set the
-sourcedir command line option to the root of your .java files.
kind regards,
Jos