Added a check for the java compiler.

Without the check, an opaque error appears in some systems, mostly
linux.

With the check, the error is still there but more transparent.