My team has recently upgraded to Java 8. We have a file which uses Lambda notations of Java 8. Gradle fails to compile this file. Here’s what we have tried to fix:
Check and make sure JAVA_HOME is set to java 1.8
Check and make sure that gradle is using the correct version of java- gradle -version give the following
Groovy: 2.3.10
Ant: Apache Ant™ version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_60 (Oracle Corporation 25.60-b23)
OS: Mac OS X 10.9.5 x86_64
Tried to explicitly set java to 8 by setting
compileJava.setSourceCompatibility(‘1.8’)
compileJava.setTargetCompatibility(‘1.8’)
tried to set org.gradle.java.home=’/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home’
It seems like the problem is with only one file. Searched the internet and didn’t find any information about this specific issue. Can anyone help me with this?