Fix StringIndexOutOfBoundsException when sys prop 'java.home' doesn't contain '/jre'