Hi Amit,

There must be some mismatch in the way the class Food.java is used inside FoodMain and where the files are physically located. Can you send the code of FoodMain and explain in which directory are located the files?

I mean, in the DOS window in which you type "javac FoodMain.java", what is the current directory and in which sub-directory are located your .java files?

Hope it helps
Mihai

Le 22/03/2011 16:47, Amit a écrit :
I dont understnad what the problem is.

In order to check my logic, I recreated the same scenario in Netbeans
and it works perfectly. Can anyone please suggest something?

I finally managed to compile my FoodMain.java by compiling both the
files simulataniously with "javac *.java", but when I try and run
FoodMain - its gives me "NoClassDefFoundError". What do you think the
problem is?

Thanks.

On Mar 22, 5:27 pm, Amit<amitah...@gmail.com>  wrote:
Hello,

I am doing the following homework exercises which asks us to create
two .java files in package foodpackage.fruitpackage. The files are
Food.java and FoodMain.java.

I created and complied Food.java and when I am doing the same for
FoodMain.java and try to access Food class from it says symbol not
found.

I am pretty sure that I have done everything correctly. And in any
case they are in the same package, so Food class should be available
to FoodMain class. Both the files are in fruitpackage directory, then
why doesnt it work? Can anyone help me on it?

Thanks

With regards.

--
To post to this group, send email to javaprogrammingwithpassion@googlegroups.com
To unsubscribe from this group, send email to 
javaprogrammingwithpassion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to