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


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.

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.

Thanks a lot.