Skip to content
Advertisement

Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. Error

I want to publish a library with Jitpackio. When I publish the library I get the following error;

"Failed to apply plugin 'com.android.internal.application'.
    Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`."

Gradle Version : 7.0.2

My Gradle JDK Version

Can you help me?

Advertisement

Answer

The problem was that JitPack.io was running with JDK1.8 on its own. Add a jitpack.yml file to the project file with this content:

jdk:
  - openjdk11

When I did that the problem went away.

Advertisement