For projects that spawn compiler daemons, follow this solution: Gradle Compiler Daemon jvm opts [solved]