Hi there.
Can you give a little more information?
Your classpath should be set to a directory that contains
the directory food as a
subdirectory.That's assuming you placed
the class file in a directory called food.
For example:
package foo;
public class MyClass{}
Say I am in directory, C:\My
Java and the source file MyClass.java is there,
I would compile MyClass.java like so:
(Note javac will look in the current directory for the source file,
by default)
javac -d . MyClass.java
The -d flag specifies where you want to place the resulting class file.
Here I specified '.' which means the current directory (C:\My Java)
and it will
also create the necessary directory 'foo' in which you will find the class file.
Now to run the class file you have to make sure your class path contains an entry that will have the directory 'foo' as a subdirectory.
Lets say we have the classpath set as a system variable like:
C:\My Java;. this means, look in C:\My Java or the current directory.
Note the ; delimiter that separates classpaths.
OR You could specifiy the classpath on the command line and
run the above class file like so: (Assume you are in the C:\My Java directory) C:\My Java>java -classpath . foo.MyClass
Hope this helps.
Best regards,
K
[ June 22, 2008: Message edited by: Keith Nagle ]