Skip to content

[fix](ci) Use actions/setup-java to install JDK 17 for BE UT macOS workflow#62820

Open
BiteTheDDDDt wants to merge 1 commit intoapache:masterfrom
BiteTheDDDDt:fix-be-ut-mac-jdk17
Open

[fix](ci) Use actions/setup-java to install JDK 17 for BE UT macOS workflow#62820
BiteTheDDDDt wants to merge 1 commit intoapache:masterfrom
BiteTheDDDDt:fix-be-ut-mac-jdk17

Conversation

@BiteTheDDDDt
Copy link
Copy Markdown
Contributor

Problem

The BE UT (macOS) workflow on macos-15 started failing with:

Check JAVA version
ERROR: The JAVA version is 25, it must be JDK-17.

Root cause

The macos-15 GitHub-hosted runner is arm64 (Apple Silicon), confirmed by job logs: Target system: Darwin; Target arch: arm64. On arm64 macOS runners, the env var JAVA_HOME_17_X64 is not set (only JAVA_HOME_17_arm64 would be), so:

export JAVA_HOME="${JAVA_HOME_17_X64%/}"  # JAVA_HOME=""

ends up empty. Then env.sh (check_jdk_version) falls back to command -v java, which on macos-15 is now JDK 25 by default, hence the failure.

Fix

Use actions/setup-java@v4 (Temurin 17) to install JDK 17 in a runner-arch-agnostic way; the action sets JAVA_HOME automatically. Drop the obsolete export JAVA_HOME="${JAVA_HOME_17_X64%/}" line.

This avoids depending on hosted-runner preinstalled JDK env vars (which differ across image versions and architectures) and matches the pattern already used by other workflows in the repo (e.g. .github/workflows/checkstyle.yaml and build-extension.yml).

Release note

None (CI fix only).

…rkflow

The macOS-15 runner was rotated to arm64 (Apple Silicon) and the
`JAVA_HOME_17_X64` env var that previously exposed the preinstalled JDK 17
is no longer set on arm64 runners. As a result, `export JAVA_HOME="${JAVA_HOME_17_X64%/}"`
left `JAVA_HOME` empty, env.sh then fell back to the system `java` (which
is now JDK 25 by default on macOS-15), and the build failed with:

    Check JAVA version
    ERROR: The JAVA version is 25, it must be JDK-17.

Use `actions/setup-java@v4` (Temurin 17) to install and expose JDK 17 in
a runner-arch-agnostic way, and drop the obsolete `JAVA_HOME_17_X64` line.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 09:28
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the BE UT (macOS) GitHub Actions workflow on macos-15 by ensuring the job consistently uses JDK 17 regardless of runner architecture, avoiding reliance on runner-specific preinstalled JAVA_HOME_* environment variables.

Changes:

  • Add a actions/setup-java@v4 step to install Temurin JDK 17 and set JAVA_HOME automatically.
  • Remove the workflow’s prior reliance on JAVA_HOME_17_X64 (which is absent on arm64 runners) and document the rationale inline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants