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

Viewed 422

I am facing issue in jenkins job(jenkins running docker) Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

I have checked java version in docker it is openjdk version "11.0.12" 2021-07-20

we can solve this in Android Studio but how can we solve while running gradle build in jenkins.

Below is the error I am getting

Build file '/var/jenkins_home/workspace/CICDDemo_master/app/build.gradle' line: 2

  • What went wrong: An exception occurred applying plugin request [id: 'com.android.application']

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.

1 Answers

In your Jenkins project choose the "configure" tab on the left side, then scroll down to "Properties Content" and write there:

JAVA_HOME=C:\Program Files\Java\jdk-11.0.12

GRADLE_USER_HOME=C:\

Related