[Interest] Android Gradle issue: use -source 7 or higher to enable diamond operator

Jason H jhihn at gmx.com
Wed Aug 24 20:10:46 CEST 2016


I'm trying to use some supplied code that relies on Java 1.7:
new HashSet<>();

error: diamond operator is not supported in -source 1.6

But in my build.gradle I have:
android {
  /* the usual ... */

  sourceCompatibility = 1.7
  targetCompatibility = 1.7

}


But I continue to get the error. What do I need to do to compile the Java 1.7 code?



More information about the Interest mailing list