Harshal Verma
08/06/2024, 7:08 PMUnsupported class file major version 61
Things I tried :
1. Changed the IntelliJ Project structure to java 11
2. Gradle settings to java 11
3. Compiler in intelliJ to java 11
4. Correctly set the path of java 11 by doing java --setup
5. Using BrazilGradle = 6.x and BrazilGradleQualityDefaults = 6.x and JDK11 = 1.0ephemient
08/06/2024, 7:10 PMHarshal Verma
08/06/2024, 7:10 PMChris Lee
08/06/2024, 7:11 PMHarshal Verma
08/06/2024, 7:11 PMHarshal Verma
08/06/2024, 7:12 PMephemient
08/06/2024, 7:14 PMChris Lee
08/06/2024, 7:14 PMHarshal Verma
08/06/2024, 7:15 PMHarshal Verma
08/06/2024, 7:15 PMephemient
08/06/2024, 7:15 PMHarshal Verma
08/06/2024, 7:16 PMHarshal Verma
08/06/2024, 7:17 PMephemient
08/06/2024, 7:17 PM$JAVA_HOME (not necesssarily the same as whatever java binary you have in $PATH)ephemient
08/06/2024, 7:17 PMHarshal Verma
08/06/2024, 7:18 PMHarshal Verma
08/06/2024, 7:18 PMChris Lee
08/06/2024, 7:19 PMHarshal Verma
08/06/2024, 7:21 PMChris Lee
08/06/2024, 7:23 PM--stacktrace to get more info on what is incompatible.
Or, use Java 17 for Gradle itself in IntelliJ, see if that works.Harshal Verma
08/06/2024, 7:24 PMHarshal Verma
08/06/2024, 7:24 PMephemient
08/06/2024, 7:24 PMephemient
08/06/2024, 7:25 PMHarshal Verma
08/06/2024, 7:27 PMChris Lee
08/06/2024, 7:28 PM./gradlew --stacktrace via Java 11.Harshal Verma
08/06/2024, 7:28 PMHarshal Verma
08/06/2024, 7:32 PMChris Lee
08/06/2024, 7:33 PMHarshal Verma
08/06/2024, 7:50 PMChris Lee
08/06/2024, 7:50 PM./gradlew --version show - the expected JVM?Harshal Verma
08/06/2024, 7:53 PMERROR: JAVA_HOME is set to an invalid directory: /Library/Java/JavaVirtualMachines/corretto-11.0.21.jdk/Contents/Home
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.Chris Lee
08/06/2024, 7:56 PM$JAVA_HOME/bin/java --version successfully.Harshal Verma
08/06/2024, 8:01 PM/usr/libexec/java_home --verboseHarshal Verma
08/06/2024, 8:01 PMChris Lee
08/06/2024, 8:03 PM$ /usr/libexec/java_home --verbose
Matching Java Virtual Machines (21):
...
11.0.23 (arm64) "<http://Amazon.com|Amazon.com> Inc." - "Amazon Corretto 11" /Users/chrislee/Library/Java/JavaVirtualMachines/corretto-11.0.23/Contents/Home
$ export JAVA_HOME=/Users/chrislee/Library/Java/JavaVirtualMachines/corretto-11.0.23/Contents/Home
$ echo $JAVA_HOME
/Users/chrislee/Library/Java/JavaVirtualMachines/corretto-11.0.23/Contents/Home
$ $JAVA_HOME/bin/java --version
openjdk 11.0.23 2024-04-16 LTS
OpenJDK Runtime Environment Corretto-11.0.23.9.1 (build 11.0.23+9-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.23.9.1 (build 11.0.23+9-LTS, mixed mode)Harshal Verma
08/06/2024, 8:06 PMHarshal Verma
08/06/2024, 8:07 PM$JAVA_HOME/bin/java --version
is running successfullyHarshal Verma
08/06/2024, 8:07 PMChris Lee
08/06/2024, 8:08 PM./gradlew --version? Or this: ./gradlew --stacktrace?Harshal Verma
08/06/2024, 8:08 PM------------------------------------------------------------
Gradle 6.9.2
------------------------------------------------------------
Build time: 2021-12-21 20:18:38 UTC
Revision: 5d94aa68c0fdbe443838bb977080e3b9f273e889
Kotlin: 1.4.20
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 11.0.21
OS: Mac OS X 14.5 aarch64Harshal Verma
08/06/2024, 8:09 PMHarshal Verma
08/06/2024, 8:12 PMChris Lee
08/06/2024, 8:13 PM./gradlew assemble --stacktrace to compile / assemble everythingHarshal Verma
08/06/2024, 8:14 PM> Configure project :
BrazilPlugin was loaded for project ''
BrazilGradleQualityDefaults plugin loaded for project ''
Code coverage report available here: file:///Volumes/coverage/index.htmlChris Lee
08/06/2024, 8:15 PM./gradlew build --stacktraceHarshal Verma
08/06/2024, 8:15 PMChris Lee
08/06/2024, 8:16 PM./gradlew --stop to shutdown all Gradle daemons;
2. Confirm in IntelliJ that the Gradle JVM is set to 17;
3. Re-run sync in IntelliJHarshal Verma
08/06/2024, 8:17 PMChris Lee
08/06/2024, 8:17 PMHarshal Verma
08/06/2024, 8:17 PMChris Lee
08/06/2024, 8:18 PMHarshal Verma
08/06/2024, 8:18 PMUnsupported Java.
Your build is currently configured to use Java 17.0.12 and Gradle 6.9.2.Chris Lee
08/06/2024, 8:19 PMHarshal Verma
08/06/2024, 8:19 PMChris Lee
08/06/2024, 8:19 PMHarshal Verma
08/06/2024, 8:20 PMChris Lee
08/06/2024, 8:21 PMHarshal Verma
08/06/2024, 8:26 PMChris Lee
08/06/2024, 8:27 PMHarshal Verma
08/06/2024, 8:30 PMChris Lee
08/06/2024, 8:31 PMrm -rf ./.gradle. And then run ./gradlew --stop, resync.Harshal Verma
08/06/2024, 8:33 PMChris Lee
08/06/2024, 8:33 PMHarshal Verma
08/06/2024, 8:33 PMhas been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.Harshal Verma
08/06/2024, 8:34 PMHarshal Verma
08/06/2024, 8:34 PMChris Lee
08/06/2024, 8:34 PMgradle-wrapper.propertiesHarshal Verma
08/06/2024, 8:34 PMdistributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/distsChris Lee
08/06/2024, 8:35 PMHarshal Verma
08/06/2024, 8:35 PMHarshal Verma
08/06/2024, 8:35 PMdistributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/distsHarshal Verma
08/06/2024, 8:35 PMChris Lee
08/06/2024, 8:37 PMgradle-wrapper.properties one must run ./gradlew wrapper to change the Gradle version.Chris Lee
08/06/2024, 8:37 PMsettings.gradleHarshal Verma
08/06/2024, 8:40 PMCannot use connection to Gradle distribution '<https://services.gradle.org/distributions/gradle-6.9.2-bin.zip>' as it has been stopped.Harshal Verma
08/06/2024, 8:40 PMChris Lee
08/06/2024, 8:44 PM./gradlew --stop. This shuts down any running Gradle daemons.Harshal Verma
08/06/2024, 8:45 PMCannot use connection to Gradle distribution '<https://services.gradle.org/distributions/gradle-6.9.2-bin.zip>' as it has been stopped.Harshal Verma
08/06/2024, 8:45 PMChris Lee
08/06/2024, 8:46 PM