Add hook for custom java flags

Enables passing of extra flags to the jvm e.g. -Xms<size> to increase the heap size.