Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrolambda - Jack is required to support java 8 - warning fix

Is there a way to disable warning about

Jack is required to support java 8 language features.

while using Retrolambda?

I don't want jack support for now since it doesn't yet compile our project.

like image 354
miszmaniac Avatar asked Jul 06 '16 12:07

miszmaniac


3 Answers

android studio

Add below codes in your application gradle after that do synck

// ----- add
buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'me.tatarka:gradle-retrolambda:3.2.4'
    }
}

repositories {
    mavenCentral()
}
// ----- end

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda' // ----- add 

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

//----add
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
like image 76
loadjang Avatar answered Oct 26 '22 17:10

loadjang


You can just remove the following configuration from your build.gradle file:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

The retrolambda plugin will take care of this anyway and setup the Java compiler task with the correct source and target compatibility settings.

like image 5
T. Neidhart Avatar answered Oct 26 '22 18:10

T. Neidhart


I confirm it is safe to remove VERSION_1_8 reference in build.gradle. Furthermore if one set jack support to true at the same time at setting JAVA Version to 1.8 and using Retrolambda, the following error kicks in:

java.lang.NullPointerException (no error message)

like image 1
ebarault Avatar answered Oct 26 '22 16:10

ebarault