• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in compiling classes  RSS feed

 
Srinivas Genji
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Been facing a simple problem,but unable to fix it.Here is my problem
Ive got two classes say
Class A and Class B
class A{
B b = new B();
}
class B
{
}
compiled my class B first and then i tried to compile class A,but its throwing me error CANNOT RESOLVE SYMBOL.
when i say javac *.java
compiles fine and gives the required output
what might be the problem
hit me fast
Thanks in Advance
Srinivas Genji
 
Prabath Siriwardena
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is because you simplye have a problem in the classpath.

Say if you save both A.java and B.java in c:\java folder.

Go inside that folder and offer following command.

c:\java\> set classpath=

The classpath will be set to the current folder. Now just compile B.java first and then A.java. You will get no problem at all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!