You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used git command to clone this repository, and then execute gradlew run in cmd. Got this problem:
H:\java\onJava\Onjava8-examples>gradlew run
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file 'H:\java\onJava\Onjava8-examples\settings.gradle' (C:\Users\hosealle\.gradle\caches\6.8.1\scripts\75ld31xr8xs8bcp4ekz1dgyh0).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 936ms
The text was updated successfully, but these errors were encountered:
You are running Gradle with JDK 17 (based on the error message "Unsupported class file major version 61").
Following the Gradle compatibility matrix JDK 15 is the highest supported Java version for Gradle versions lower than 7.0. The wrapper in the repository is configured to be version 6.8.1.
To solve the issue, the easiest (without changing anything in the repository) would be to run gradlew with a JDK version lower than 16.
Another possibility could be to update the Gradle wrapper to version 7.3 (as this one would support JDK 17). But updating the wrapper probably require other changes too.
I found the solution worked for me: modify the file named java.gradle in the gradle subfolder, change the sourceCompatibility and targetCompatibility to the jdk version you're using, then everything works fine.
I used git command to clone this repository, and then execute
gradlew run
in cmd. Got this problem:The text was updated successfully, but these errors were encountered: