How to change JAVA_HOME using gradle.proeprties?


(dinio.dinev) #1

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: http://gradle.org/docs/1.7/userguide/gradle_daemon.html.
  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 http://gradle.org/docs/1.7/userguide/gradle_daemon.html
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?


(Luke Daley) #2

‘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


Gradle not finding java tools.jar
(dinio.dinev) #3

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:

org.gradle.java.home=C:/Program Files/Java/jdk1.6.0_45
org.gradle.jvmargs =-XX:MaxPermSize=64m

Thanks, Luke.


(Luke Daley) #4

No problem, you’re welcome.