Forums Register Login

Compilation Error: cannot resolve symbol

+Pie Number of slices to send: Send
Hi Friends,

Consider this is simple examples.

i have created 2 class in the bin directory.

public class Example1 {
}
public class Example2{
Example1 ex1 = new Example1();
}

I tried to compile these 2 files.Example1 is compiled fine.
I tried to compile the class Example2 it giving compilation error:
cannot resolve symbol class Example1

Please help me out what the mistake i had done.Whats the reason for the compilation error?

Help me !

Thanks & Regards,
Prasath
+Pie Number of slices to send: Send
both works fine my friend

i compiled both

check the spelling and character case
+Pie Number of slices to send: Send
If your current directory is one directory above "bin" and you say "javac bin/Example2.java", the compiler will not look in "bin" for Example1, and you'll get a compiler error. There are three ways to deal with this. First, you could compile with "bin" as your current directory. Second, you could tell the compiler that "bin" is a directory in which to find other classes:

javac -cp bin bin/Example2.java

Third, you could compile both files at once:

javac bin/Example1.java bin/Example2.java
[ October 07, 2005: Message edited by: Ernest Friedman-Hill ]
+Pie Number of slices to send: Send
Thank u very much Mr Ernest Friedman-Hill

regards,
Prasath
Nothing up my sleeve ... and ... presto! A tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 697 times.
Similar Threads
OO concept order of processing question
Not working with 1.5
noob cp problems in webapp
problem in Compiling servlets
dought!!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:49:56.