Set JAVA_HOME on OS X only.

Java 7 is not installed by default. To use Java 7 or later on OS X 10.9,
it looks like we need to follow subtle installation process unfortunately.