This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Anyone tried to compile KHM Book ex #4.8. I am getting compiling error in package B "package A not found" but it is in same directory. I am using JDK 1.3 and jcreator. Any suggestion :confused
Jane Griscti
Ranch Hand
Joined: Aug 30, 2000
Posts: 3141
posted
0
Hi Wasim, I don't have a copy of the code but if by 'it is in the same directory' you mean the compiled class file is in the same directory as the class marked package B you will get a compile error. If you have two source files, one marked 'package A;' and another marked 'package B' your directory set up should be
You then need to compile from the 'root' directory using
Java expects the package naming to follow the directory structure. 'package A' instructs the compiler to look for the source file in the 'A' subdirectory. 'package B' instructs the compiler to look for the source file in the 'B' subdirectory. It searches for the subdirectories in the current directory. Hope that helps. ------------------ Jane Griscti Sun Certified Programmer for the Java� 2 Platform