You could save some cut and paste here like:
```
if [[ "$java_version" < "1.8" ]]; then
  PERMSIZE=-XX:MaxPermSize=${perm}m
fi
echo "-Xms${mem}m -Xmx${mem}m $PERMSIZE -XX:ReservedCodeCacheSize=${codecache}m"
```