Can't build Java 1.8 even with proper Java version in use

Ok, interesting. So, I am getting Java 7 from Gradle but Java 8 from the command line. What’s going on here?

From Gradle: /Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre

From Command Line: JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home

I did find this…

http://stackoverflow.com/questions/22307516/gradle-finds-wrong-java-home-even-though-its-correctly-set

What should I do?