The documentation is not very clear on what all the available options are…
after much Googling and many different attempts finally figured out how to raise the maximum heap of the compiler from within the gradle script.
apply plugin: 'java' compileJava { //raise heap options.fork = 'true' options.forkOptions.with { memoryMaximumSize = "2048m" } }