Specifies Java 6 when finding JAVA_HOME on OSX

This is a backport of b1f1ac28666bcf348a176d37e90f636dc5352539