How to change JAVA_HOME using gradle.proeprties?

Hi, I tried to change JAVA_Home through gradle.proeprties with: org.gradle.jvmargs=C:\Program Files\Java\jdk1.6.0_45

but have this error

To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon:
  FAILURE: Build failed with an exception.
  * What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at
Please read below process output to find out more:
Error: Could not find or load main class C:Program FilesJavajdk1.6.0_45

I can change it using : set JAVA_HOME=“C:\Program Files\Java\jdk1.6.0_45” but I want to be changed through properties.gradle in the home directory. How to deal with this problem?

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

You want ‘’, see:

ooh sorry I knеw that I do something stupid I set another JVM arguments so a just copied org.gradle.jvmargs for JAVA_HOME For example the right was: Files/Java/jdk1.6.0_45
org.gradle.jvmargs =-XX:MaxPermSize=64m

Thanks, Luke.

No problem, you’re welcome.