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


(Daniel Svojanovský) #1

Hi,

I need to pass -J parameters to javac process. Unfortunately, according to http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/javac.html#commandlineargfile -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.