first off, the class definition for P2 is wrong..where is the declaration for the method containing the call afancymethod? it's missing. P2 will not even compile because it's not Java syntax ;-)
second, the answer is not too clear, the reason it will not compile is because afancymethod is package private and hence not visible from P2 since P2 is in a different package.
Also, the compile directory has to be "MyPackage", if not you'll get errors.
Also, the classpath to the compiler has to be specified as one level below "MyPackage" otherwise you'll get more errors.
Another thing...the import statement is missing for P2
[ June 27, 2008: Message edited by: Kevin Smither ]