Merge -c 1296861 from trunk to branch-0.23 to fix HADOOP-8123. Use java.home rather than env.JAVA_HOME for java in the project.