How can I fix "unsupported class file major version 60" in IntelliJ IDEA?
Solution 1:
I fixed this problem by changing the Gradle JVM settings in IntelliJ settings:
-
In the Settings/Preferences dialog, go to Build, Execution, Deployment → Build Tools → Gradle.
-
Under the Gradle section, change the Gradle JVM option. Select a Gradle JVM which works for you.
See Resolve the Gradle JVM version for the existing project
Solution 2:
For me, it was fixed by upgrading the Gradle version.
In the file under the directory gradle/wrapper/gradle-wrapper.properties
, just change the version number of Gradle. For example, if your Gradle version is 6.3
, change this:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
to:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
It is not available in File → Project Structure → Project for the project I was working with.
Solution 3:
Upgrading Gradle version 6.8.3 to 7.0 solved my problem. You can upgrade it:
- Menu File → Project Structure → Project (on the left panel)
- Change to Gradle version 7.0
It works with the Android Gradle plugin version 4.2.0.