Fix for #1359346 Java version detection

Improved code to properly detect Hadoop's java version instead of
java version of just any java program that was running

Also added error message to catch case when unable to determine
the java version which will now stop execution instead of
continuing and installing the wrong java version like it used
to do.

Change-Id: Iac902fe27e72d9c055c9170d5324e88739441fbb
Merge "Fix for #1359346 Java version detection"