How can I get javac to find child classpaths?
1 answer
The short answer is no, this is not how class directories work.
Each pathpath is considered the root of the package structure. Each package is a directory at the root. So javac will do it automatically if aa is the packages directory and a is the root. You will look like this:
/a/A.java
class A {}
/a/aa/AA.java
package aa;
class AA {}
/b/B.java
package b;
import aa.AA;
class B {
private AA aaInstance;
private A aInstance;
}
Since A has no package, it is placed in the root package.
Otherwise, you need to set each dir explicitly.
+3
source to share