Correctly use JAVA_HOME when generating SWIG bindings

Fix some compilation problems on windows with multiple java install or java not in path but with a correct JAVA_HOME defined
Merge pull request #4387 from Tolriq/swig_javahome

Correctly use JAVA_HOME when generating SWIG bindings