Fixed java version checking to work on Mac and Windows