Jun 19, 2014

Set up gradle to build with alternative java

I am using ubuntu 14.04 LTS

Having java 7 and 8 installed from oracle.

Using alternative and working with java 7 but one of my projects use java 8.

gradle build --version

returns that it works with java 7 -> since most of my projects use this version, i don't want to change this.

Solution: creating in the java 8 project, in the root directory, file named gradle.properties

inside it for example in my case :
org.gradle.java.home=/usr/lib/jvm/java-8-oracle/


this way, when you will do gradle build in this project, gradle will use this version instead of the one defined for him.


Hoped it helped,

Dor

No comments:

Post a Comment