should beclasses\com\examples\model
classes\com\example\model
error and yet I have followed the book instruction to a tee (code, directories, etc). I am wondering if the book may be in error since the import statement points to a directory that contains only a java file instead of a class file (as shown below). As instructed by the book, the class file, which the import statement points to, is not in thepackage com.example.model does not exist
directory -- rather it is in thesrc\com\example\model
directory (right where the -d command SHOULD put it).classes\com\examples\model
Originally posted by L�szl� Kov�cs:
Having just tested it out, I can see that my guess was wrong. Your classes both compile and run here. I should carry on reading my book and not butt in!
However, you (or someone else reading this) might be interested to know that the first time I tried to compile MovieTestDrive.java I got the exact same error that you did. Then I tried to run some of the other packageless examples that I've made while following the book I'm reading and I got the same error: the reason, in my case was that I had set a classpath environment variable which meant that javac was looking for the class in the wrong folder - not looking in the same folder as the one I compiled the Movie class in.