/top
|-----wrk
*****|------pkg
*********|----A.java
*********|----B.java
star here only repesent space
//Filename A.java
package pkg;
class A{ B b ;}
//Filename B.java
package pkg;
class B{........}
when i am trying to compile it
Current directroy : /top/wrk
command: javac -cp . pkg/A.java
its fine
but when i am trying to compile by
Current directroy : /top/wrk
command: javac -cp .:pkg pkg/A.java
i got an error like this
C:\Documents and Settings\vinit\Desktop\wrk>javac -cp .:pkg pkg/A.java
pkg\A.java:4: cannot find symbol
symbol : class B
location: class pkg.A
B b;
^
1 error
why???
This message was edited 3 times. Last update was at by Bear Bibeault
It doesn't matter if you win by an inch or a mile; winning's winning.
Prithvi Sehgal
Ranch Hand
Joined: Oct 13, 2009
Posts: 735
posted
0
Please use code tags so that it becomes more readable and can be answered precisely.
The classpath is only for the top level directories. There is no need to specify the pkg directory. Try removing it. Also, delete all you .class files -- just in case there is one that is interferring with the compilation.