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

add a

println System.getProperty(“java.home”)

in your build gradle; on a Mac this should output something like

/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/jre