Consider the following two Java classes:
a.) class Test { void foo(Object foobar) { } }
b.) class Test { void foo(pkg.not.in.classpath.FooBar foobar) { } }
Furthermore, assume that pkg.not.in.classpath.FooBar
is not found in the classpath.
The first class will compile fine using the standard javac.
However, the second class won't compile and javac will give you the error message "package pkg.not.in.classpath does not exist"
.
The error message is nice in the general case since checking your dependencies allows the compiler to tell you if you got some method argument wrong, etc.
While nice and helpful this checking of dependencies at compile-time is AFAIK not strictly needed to generate the Java class file in the example above.
Can you give any example for which it would be technically impossible to generate a valid Java class file without performing compile time dependency checking?
Do you know of any way to instruct javac or any other Java compiler to skip the compile time dependency checking?
Please make sure your answer addresses both questions.