another question driving me crazy...# Java - 爪哇娇娃
q*c
1 楼
say I have two packages B and C put as
in the directory /A/B and /A/C. The classpath is set as /A.
so when compiling them, no problem at all.
Now have a test class named Cplot.class in /A/C.
When run it, it gives message:
"Exception in thread "main" java.lang.NoClassDefFoundError: Cplot".
I find since classpath is set as /A, java cannot find this Cplot.
So I add /A/C to the classpath, but it gives message:
"Exception in thread "main" java.lang.NoClassDefFoundError: Cplot (wrong name:
A/C/Cplot).
in the directory /A/B and /A/C. The classpath is set as /A.
so when compiling them, no problem at all.
Now have a test class named Cplot.class in /A/C.
When run it, it gives message:
"Exception in thread "main" java.lang.NoClassDefFoundError: Cplot".
I find since classpath is set as /A, java cannot find this Cplot.
So I add /A/C to the classpath, but it gives message:
"Exception in thread "main" java.lang.NoClassDefFoundError: Cplot (wrong name:
A/C/Cplot).