I'm trying to figure out packages and directory structures, and am having problems executing an application that uses a couple of packaged classes ("geometry" is the name of the package). My directory tree includes a D:\practice\geometry (wherein reside Line.java and Point.java, the two classes in the package geometry), and a D:\practice\source, which contains the main program, TryPackages. I can compile the Line class using "javac -classpath D:\practice Line.java" (and similarly for Point), and I can also compile TryPackages.java (which imports the two aforementioned classes using "import geometry.*;"), but when I try to execute TryPackages, I get the following error:
"Exception in
thread "main" java.lang.NoClassDefFoundError: TryPackages"
Can someone please tell me what I'm doing wrong?
(sorry for the verbose posting!)
Thanks,
Chris