How to change JAVA_HOME using gradle.proeprties?

‘org.gradle.jvmargs’ is literally the extra args used to fork the JVM, not the ‘JAVA_HOME’ location.

You want ‘org.gradle.java.home’, see: http://www.gradle.org/docs/current/userguide/build_environment.html