Skip to content

openjdk: boot-jdk resource is arm64-only, source build fails on Intel macOS ("Bad CPU type in executable") #320698

Closed as not planned

Description

@Tolik-Trek

brew config AND brew doctor output

HOMEBREW_VERSION: 7.0.10
macOS: 15.8.2-x86_64
CLT: 26.3.0.0.1.1771626560
Xcode: 26.3
CPU: 20-core 64-bit skylake
$ brew doctor
Warning: Some installed casks are deprecated or disabled (djview, far2l, gstreamer-runtime, jd-gui, wine@devel).
Warning: Some installed formulae are deprecated or disabled (git-flow, icu4c@76, pidof, python@3.9).
Warning: Unbrewed dylibs/header files/.la files/.pc files/static libraries were found in /usr/local (libqucs, pci).
Warning: /usr/bin occurs before /usr/local/bin in your PATH.

(Full brew doctor output available on request; none of these are related — the failure is a wrong-architecture resource download inside the sandboxed build.)

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.
  • My issue is not about a failure to build a formula from source.
  • I did not use AI/LLM to create this issue, or I disclosed the tool and model used; I will answer maintainer questions myself without AI/LLM.

AI disclosure: drafted with AI assistance (Kimi Code agent); the failure, the root-cause analysis and the proposed fix were verified on the reporter's machine (build completed successfully with the fix applied), and the reporter will answer maintainer questions.

What were you trying to do (and why)?

brew upgrade openjdk (27 -> 27.0.1.0.2). On x86_64 macOS there are no bottles, so this builds from source by default.

What happened (include all command output)?

configure rejects the boot JDK:

configure: Potential Boot JDK found at .../boot-jdk/Contents/Home is not a working JDK; ignoring
configure: Output from java -version was: .../bin/java: Bad CPU type in executable
configure: error: The path given by --with-boot-jdk does not contain a valid Boot JDK

Root cause: since JDK 27, the boot-jdk resource in the formula has only a macOS aarch64 URL (openjdk-27_macos-aarch64_bin.tar.gz, no on_intel block). On Intel macOS Homebrew therefore stages an arm64 JDK as the boot JDK, and the build cannot even start. OpenJDK stopped publishing macOS x64 binaries with JDK 27 (https://jdk.java.net/archive/ lists only Mac/AArch64 for 27 GA), but building JDK 27 from source on x64 works fine with the previous release as the boot JDK.

What did you expect to happen?

The formula provides an Intel-appropriate boot JDK and the source build succeeds.

Step-by-step reproduction instructions (by running brew commands)

brew update
brew upgrade openjdk    # on x86_64 macOS (no bottle): builds from source, fails as above

Suggested fix: split the macOS boot-jdk resource into on_arm (current JDK 27 aarch64 URL) and on_intel using the last published x64 GA, e.g.:

on_intel do
  url "https://download.java.net/java/GA/jdk26.0.2.1/3b8e6c7ec6274148a7aa15e7e7dfb53c/1/GPL/openjdk-26.0.2.1_macos-x64_bin.tar.gz"
  sha256 "5ec3817530ffa1c38f15a55609a2767335bbd0c59ea8ce41aad68d3cd620c0ae"
end

Verified locally: with this change brew upgrade openjdk builds 27.0.1.0.2 successfully on x86_64 (boot JDK 26.0.2.1 x64, JDK 27 accepts the previous release as boot JDK), and the resulting java is a working x86_64 binary.

Activity

  1. cho-m commented on Oct 23, 2026

    @cho-m
    Member

    Closing as we do not use issue tracker for source build issues and Support Tier 3 issues1. Either open a pull request or use https://github.com/orgs/Homebrew/discussions

    Footnotes

    1. https://docs.brew.sh/Support-Tiers#tier-3 ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions