Smarter javaHome in SBT

Make javaHome settings in SBT build smarter.