Retrolambda - Android Studio

1) add the retrolambda plugin to the repositorie on build.gradle

 ...
 buildscript {
     repositories {
         jcenter()
+        mavenCentral();
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:0.13.+'
+        classpath 'me.tatarka:gradle-retrolambda:2.4.0'
     }
 ...

2) use the plugin on the app build.gradle and tell android studio to use JAVA8 sintax

     apply plugin: 'com.android.application'
+    apply plugin: 'retrolambda'


    android {
        compileSdkVersion 14
        buildToolsVersion "20.0.0"
    ....
    +    compileOptions {
    +        sourceCompatibility JavaVersion.VERSION_1_8
    +        targetCompatibility JavaVersion.VERSION_1_8
    +    }
    ....

3) set environment variables of JAVA_HOME and JAVA6_HOME, if you are on macos 10.10 (yosemite) seems that is too complex to set global environment variables so I set them directly to the gradle, if you are working within a team please, pleeeease use a properties file

retrolambda {
    jdk "/System/Library/Frameworks/JavaVM.framework/Versions/Current/Home"
    oldJdk "/System/Library/Frameworks/JavaVM.framework/1.6/Current/Home"
    javaVersion JavaVersion.VERSION_1_6
}