Java - fix lambda expression either with version or conversion

I am trying to add a custom capacitor plugin to my android app. Works for iOS, currently I am integrating it into android.

I am no Java developer, my Java knowledge is fairly old.
The build step of the app that builds the plugin alongside throws

        request.addOnCompleteListener(task -> {
                                           ^
  (use -source 8 or higher to enable lambda expressions)
  1. Where can I amp up my Java version to 8 in my ionic project to build with lambdas? Where is that version set? I can not find the maven config (if that is related).
  2. How could I make this compatible with -source 7 ?
        Activity activity = this.cordova.getActivity();
        ReviewManager manager = ReviewManagerFactory.create(activity);
        Task<ReviewInfo> request = manager.requestReviewFlow();


        request.addOnCompleteListener(task -> {

            if (task.isSuccessful()) {
                ReviewInfo reviewInfo = task.getResult();
                Task<Void> flow = manager.launchReviewFlow(activity, reviewInfo);
                flow.addOnCompleteListener(launchTask -> {
                    if (task.isSuccessful()) {
                        callbackContext.success();
                    } else {
                        Exception error = task.getException();
                        callbackContext.error("Failed to launch review - " + error.getMessage());
                    }
                });
            } else {
                Exception error = task.getException();
                callbackContext.error("Failed to launch review flow - " + error.getMessage());
            }

        });

This is a cross post on SO
The code is essentially the bare google api example

Ok, figured it out. I had to fix MyComponent/android/build.gradle in the new capacitor component with

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

in

android {
    compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 29
    defaultConfig {
        minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
        targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }
}