Use the configured JDK and Scala library when building.

Make sure the Sbt builder uses the configured JDK and
Scala library. Make sure Sbt does not infer some default
libraries for `-bootclasspath`, or the JDK used for running
Eclipse.

Fixed #1001387

Should be backported.