Use JAVACMD rather than path-default java to check Java version

Copy caskdata/cdap#741 to use JAVACMD... thanks @sumitsu