Android java.lang.IllegalArgumentException: Unsupported class file major version 61
Asked Answered
G

0

7

Hello everyone once I update my android studio to Arctic fox while publishing the artifact(command - ./gradlew assembleRelease artifactoryPublish) I am getting this error. I have written below gradle details please help me out for the same

JDK version: 11

gradle.properties or gradle version

https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

Build tool version

 classpath 'com.android.tools.build:gradle:7.0.3'

Kotlin Version

1.5.31
Guy answered 21/10, 2021 at 18:44 Comment(4)
Major version 61 is Java 17 - javaalmanac.io/bytecode/versions. The Java version you are using on the command line is Java 17, not Java 11 - fix that in the command line environment, be it bash, zsh or cmd. The project setup JDK (Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JDK) can differ from the command line env JDK. Type javac -version to confirm. Also try running the gradle task directly from the gradle tasks list in the IDE - the will use the Project JDK if you are not successful setting the command line JDK.Backandforth
@MarkKeen I am executing that command(./gradlew assembleRelease artifactoryPublish) from the android terminal and after checking java version from android terminal its showing 17 but I can see the project setting its 11 not sure why its talking system java JDK not android oneGuy
please check this: https://mcmap.net/q/137499/-android-studio-error-quot-unsupported-class-file-major-version-61-quotOutsider
@Backandforth very useful comment and clearly explains what's wrong. Thanks!Biography

© 2022 - 2024 — McMap. All rights reserved.