I found that if I compile class B first and then compile class A, it's OK.
public class A {
public A() {
B b = new B();
}
}
public class B {
}
And if I add main() method to class A
public static void main(String[] args) {
A a = new A();
}
then run class A. Now it works well!
Update at 6:57 PM: If you meet this problem, please enable Settings | Project Settings | Compiler | Honor dependencies on "Compile" command.
Thanks Sascha Weinreuter! But I think that it should be enable by default.
No comments:
Post a Comment