I beleive tha this is about "How java find a class" and the "CLASSPATH" environment variable.
See. if I have no CLASSPATH set and I try the following I get an error.
imp.java:2: Package test not found in import.
Then I set the CLASSPATH variable one level below the package name. I get no problem to compile.
Note that you have to get the full name class variable (including package name).
Hope that this help.