Skip to content

Compile Java 8-compatible artifacts without requiring JDK 8 - #49

Merged
litlep-nibbyt merged 1 commit into
mainfrom
joie/java8-release-compat
Nov 11, 2026
Merged

litlep-nibbyt merged 1 commit into
mainfrom
joie/java8-release-compat

Conversation

@litlep-nibbyt

@litlep-nibbyt litlep-nibbyt commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Replace the Java 8 Gradle toolchain requirement with Java 8 source and target compatibility.
  • Compile with --release 8 to enforce Java 8 bytecode and standard-library API compatibility.
  • Continue running Gradle and tests with the JDK explicitly installed by CI.

Why

The ubuntu-latest GitHub Actions runner moved from Ubuntu 24.04 to Ubuntu 26.04. The older image included JDK 8, while the newer image does not.

The workflow explicitly installs Java 11, but the Gradle build requested an actual Java 8 compiler toolchain. This meant the build implicitly depended on JDK 8 being preinstalled by the runner image. Once that changed, Gradle failed before running tests:

Cannot find a Java installation on your machine matching this task's requirements: languageVersion=8.

Using --release 8 preserves Java 8 bytecode and API compatibility without requiring an installed JDK 8 toolchain. It also matches the compatibility approach used by the main Temporal Java SDK.

Failed run: https://github.com/nexus-rpc/sdk-java/actions/runs/42727692815

Testing

  • ./gradlew --no-daemon test
  • ./gradlew --no-daemon -x spotlessCheck
  • git diff --check

CI verification

To verify that this change directly addresses the runner-image dependency, the old Java 8 toolchain configuration was temporarily restored on this branch and tested against the current GitHub Actions runner.

This confirms that the failure is caused by relying on JDK 8 from the runner image and that compiling with --release 8 removes that dependency.

@litlep-nibbyt
litlep-nibbyt marked this pull request as ready for review November 10, 2026 01:33
@litlep-nibbyt
litlep-nibbyt requested a review from a team as a code owner November 10, 2026 01:33
@litlep-nibbyt
litlep-nibbyt force-pushed the joie/java8-release-compat branch from f9acd88 to 7bc04ba Compare November 10, 2026 01:38
@litlep-nibbyt
litlep-nibbyt marked this pull request as draft November 10, 2026 01:40
@litlep-nibbyt
litlep-nibbyt marked this pull request as ready for review November 10, 2026 01:41
@litlep-nibbyt
litlep-nibbyt merged commit 6531d8f into main Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants