Explicitly set javaHome when the path to java is configured.

Whether via JAVA_HOME or -java-home. Otherwise sbt will use
whatever version of javac is first in your path.