This kind of circular dependency is automaticaaly handled by Java compiler. It doesn't matter which file you compile first A.java or B.java. If you compile A.java using javac then B.java will be compiled as well and vice-versa. So, just try to compile A.java and you will have both A.class and B.class .
I already know what you said, but I was gotting the following errors,
C:\Documents and Settings\computo\My Documents\Julio\Pruebas\Dir1>javac A.java A.java:3: package Dir2 does not exist import Dir2.*; ^ A.java:8: cannot resolve symbol symbol : class B location: class Dir1.A B b; ^ 2 errors
But AT THIS TIME I solved the problem compiling in the parent directory, and using the option -classpath . , that is, with the following command line.
C:\Documents and Settings\computo\My Documents\Julio\Pruebas>javac -classpath . Dir1\A.java