Guard java-specific swig code with SWIGJAVA.

Without this building just the python bindings will fail.