Add hook for custom java flags

Allows passing of extra commands for the jvm e.g. -Xms512m to increase
the heap size.