I'm not a Gradle expert, but I think that "-Xmaxerrs" is a javac option, not a JVM options. I think you can solve your issue by following this advice.