Is there an option to pass -J parameters to JavaCompile task?

(Daniel Svojanovský) #1


I need to pass -J parameters to javac process. Unfortunately, according to -J is not supported with argument files.

Is there any way how to pass it directlty? Would it be possible to add it to CompileOptions?

Thank you.

(Peter Niederwieser) #2

Have a look at ‘CompileOptions#forkOptions’, which has properties such as ‘memoryMaximumSize’ and ‘jvmArgs’ (see Javadoc for details). Note that you’ll have to set ‘compileOptions.fork = true’ for this to take effect.

(Daniel Svojanovský) #3

Thanks a lot.