gradle-build-action
gradle-build-action copied to clipboard
Exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63
Build with gradle-build-action
on ubuntu-latest
:
* What went wrong:
Could not open cp_init generic class cache for initialization script '/home/runner/.gradle/init.d/build-result-capture.init.gradle' (/home/runner/.gradle/caches/7.5.1/scripts/1e64q25zpdl12rebgg3luboth).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63
But if I replace ubuntu-latest
with buildjet-8vcpu-ubuntu-2204, no error occurred.
My env: Gradle 7.5.1
, gradle-build-action@v2
, ubuntu-latest
, Java 19
, you can repro this issue on https://github.com/Goooler/DemoApp/pull/235.
Gradle 7.5.1 does not support running on Java 19. I suspect that's the cause of the exception you're seeing, but I don't understand why switching to a different runner fixes it.
Can you please check if this problem occurs when running on Java 18, the newest version supported for Gradle 7.5.1? https://docs.gradle.org/7.5.1/release-notes.html#new-features-and-usability-improvements
but I don't understand why switching to a different runner fixes it.
I'm suspecting the /home/runner/.gradle/init.d/build-result-capture.init.gradle
hadn't been restored on buildjet-ubuntu?
Test on Java 18, it works, see https://github.com/Goooler/DemoApp/pull/238.
I was also running lint tasks on Java 19, they were workable, just failed on the build job, the build-result-capture.init.gradle
is only dependent on builds?
Alright, /home/runner/.gradle/init.d/build-result-capture.init.gradle
has been restored on BuildJet now, I'm closing this issue, more info see https://github.com/Goooler/DemoApp/actions/runs/3307540358/jobs/5459270891