0

I am getting below error when i build my application.Any help would be appreciated.

Root:build.gradle

buildscript {
    ext.kotlin_version = '1.3.50'

    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

settings.gradle

include ':app'

app:build.gradle

apply plugin: 'java'

compileJava {
    options.compilerArgs << '-parameters'
    options.fork = true
    options.incremental = true
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.squareup:javapoet:1.10.0'
    implementation ("org.checkerframework:checker:2.1.10")
    testImplementation 'org.mockito:mockito-core:3.2.0'
}

FAILURE:Build failed with an exception. *Where:Settings file'/Users/Documents/android/MyApplication5/settings.gradle' *What went wrong:Could not compile settings file'/Users/anand/Documents/android/MyApplication5/settings.gradle'.>startup failed:General error during semantic analysis:Unsupported major version 57 java.lang.IllegalArgumentException:Unsupported major version 57

1error

Andronicus
  • 23,098
  • 14
  • 38
  • 73
Ananth
  • 93
  • 3
  • 13
  • 2
    You're trying to load a class compiled for OpenJDK 13 with an older JVM. For example, your gradle may be picking a wrong JDK install for itself or for the compilation (those can be different). – oakad Jan 13 '20 at 05:50

1 Answers1

0

Make sure both target and source version in your pom.xml file are the same. Edit: There is no separate JREs for Java 9+ so make sure your JRE path leads to your JDK.

scaldings
  • 33
  • 4