Gradle build fails with "org/eclipse/jgit/storage/file/FileRepositoryBuilder has been compiled by a more recent version of the Java"

Viewed 2368

Starting from today I cannot build my project anymore. There are no changes in it. Looks like some Gradle dependency is recompiled with Java 11. I'm using Java 8 and Gradle 4.10.

org/eclipse/jgit/storage/file/FileRepositoryBuilder has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Does anyone have the same problem?

    ./gradlew --version
    
    ------------------------------------------------------------
    Gradle 4.10.3
    ------------------------------------------------------------
    
    Build time:   2018-12-05 00:50:54 UTC
    Revision:     e76905e3a1034e6f724566aeb985621347ff43bc
    
    Kotlin DSL:   1.0-rc-6
    Kotlin:       1.2.61
    Groovy:       2.4.15
    Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
    JVM:          1.8.0_292 (Private Build 25.292-b10)
    OS:           Linux 4.15.0-142-generic amd64
    echo $JAVA_HOME
    /usr/lib/jvm/java-8-openjdk-amd64/
./gradlew clean

FAILURE: Build failed with an exception.

* What went wrong:
org/eclipse/jgit/storage/file/FileRepositoryBuilder has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
1 Answers

I've changed the version of Gradle plug-in org.ajoberstar.grgit in build.gradle and it is working. The version before was 4.1.0. Now: 4.1.1

plugins {
    id 'java'
    id "org.ajoberstar.grgit" version "4.1.1"
}
Related