Fix string index out of range issue if java.home path does not have the jre suffix

I'm using gradle-retrolambda on Mac OS X 10.9 with JDK 8u11 x64 and the default java.home path does not end with /jre. I made a check to only remove /jre if found, otherwise just take the path as is. This fixes the string out of range -1 error I was getting when building.