Fix SpotBugs UnsupportedClassVersionError by running with Java 11#234
Fix SpotBugs UnsupportedClassVersionError by running with Java 11#234
Conversation
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
…y issues Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
|
Done! I've completely removed SpotBugs from the project as suggested. All SpotBugs plugins, configurations, CI steps, and exclude files have been removed. This should resolve the Java compatibility issues. Commit: f8bc07b Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Setup Gradle |
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Fixed the Gradle cache service 400 error by updating gradle-build-action from v2 to v3. This version has improved caching reliability and should resolve the cache restoration issues. Commit: 8f6608c |


The CI build was failing with the following error when running SpotBugs:
Root Cause:
The CI workflow sets up both JDK 11 and JDK 8, but then uses JDK 8 as the default when running SpotBugs. However, SpotBugs 4.9.2 was compiled with Java 11 (class file version 55.0) and requires Java 11+ to run, while Java 8 only recognizes class file versions up to 52.0.
Solution:
Modified the CI workflow to run the SpotBugs steps with the
JDK_11environment variable that's already set up in the workflow. This follows the same pattern as the unit tests which already useJDK_11.Changes Made:
.github/workflows/build-validation.ymlto exportJAVA_HOME=$JDK_11before running SpotBugsBefore:
After:
This is a minimal, surgical fix that resolves the version compatibility issue without changing any build logic. The CI will now successfully run SpotBugs analysis on all builds.
Fixes #233.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https(dns block)https://api.github.com/repos/microsoft/durabletask-protobuf/commitsREDACTED, pid is -1(http block)rt.services.visualstudio.com/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-7.4-bin/c0gwcg53nkjbqw7r0h0umtfvt/gradle-7.4/lib/gradle-launcher-7.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4(dns block)/usr/lib/jvm/java-8-openjdk-amd64/bin/java -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-7.4-bin/c0gwcg53nkjbqw7r0h0umtfvt/gradle-7.4/lib/gradle-launcher-7.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4(dns block)/usr/lib/jvm/temurin-11-jdk-amd64/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-7.4-bin/c0gwcg53nkjbqw7r0h0umtfvt/gradle-7.4/lib/gradle-launcher-7.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.