fix(java): newer zulu versions use a different directory structure#9365
fix(java): newer zulu versions use a different directory structure#9365
Conversation
Greptile SummaryThis PR fixes Java installation for newer Zulu versions on macOS, which ship with a flat Confidence Score: 4/5Safe to merge for the Zulu fix, but the implicit behavior change for Liberica on macOS (flagged in previous threads) is worth confirming before landing. The fix correctly addresses new-style Zulu macOS packaging and gracefully handles both layouts via filesystem probing. No new regressions are introduced beyond the Liberica side-effect already discussed in previous review threads. Score held at 4 until the Liberica behavior change is explicitly confirmed as intentional or a Liberica-specific guard is added. src/plugins/core/java.rs — specifically the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[move_to_install_path] --> B{os == macosx AND\nContents/Home is dir?}
B -- Yes --> C[source_dir = basedir/Contents/Home\nnew-style flat layout]
B -- No --> D[source_dir = basedir\nclassic layout]
C --> E[Move source_dir entries\nto install_path]
D --> E
E --> F{cfg macos?}
F -- Yes --> G[handle_macos_integration\nwith basedir/Contents]
F -- No --> Z[Done]
G --> H{basedir/Contents exists?}
H -- Yes --> I[Move non-Home entries\nto install_path/Contents]
I --> J[Symlink install_path/Contents/Home\n→ install_path]
H -- No --> K{vendor == zulu?}
J --> K
K -- Yes --> L{zulu-N.jdk/Contents exists\nAND install_path/Contents absent?}
L -- Yes --> M[Symlink install_path/Contents\n→ install_path/zulu-N.jdk/Contents\nold-style Zulu only]
L -- No --> N[Skip symlink\nnew-style Zulu]
K -- No --> Z
M --> Z
N --> Z
Reviews (2): Last reviewed commit: "fix(java): newer zulu versions use a dif..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Updates the Java core plugin’s macOS install logic to better handle Zulu JDK tarballs whose extracted directory layout differs across newer versions (issue #9337), avoiding incorrect moves and failing symlink operations.
Changes:
- Detect and use
Contents/Homeas the extraction source directory on macOS when present (instead of vendor-based branching). - Make the Zulu
Contentssymlink creation conditional on the expected directory existing and the link not already being present.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request refactors the Java plugin's logic for determining the installation source directory on macOS, moving from a vendor-specific check to a path existence check for 'Contents/Home'. It also updates the Zulu-specific symlinking process to include safety checks and simplifies version string parsing. Review feedback suggests using is_dir() instead of exists() for more explicit directory validation and simplifying the major_version extraction logic.
### 🚀 Features - **(registry)** add --security flag to include security info in JSON output by @jdx in [#9364](#9364) ### 🐛 Bug Fixes - **(config)** limit resolved backend opts to aliases by @risu729 in [#9315](#9315) - **(docs)** stack banner message and link on mobile by @jdx in [#9362](#9362) - **(github)** prefer shortest asset name as tiebreaker in auto-detection by @jdx in [#9361](#9361) - **(java)** newer zulu versions use a different directory structure by @roele in [#9365](#9365) - **(prune)** respect tracked lockfiles by @jdx in [#9373](#9373) - **(task)** skip tool install for missing naked tasks by @jdx in [#9374](#9374) - **(trust)** add untrust command by @jdx in [#9370](#9370) - fix - flux-operator-mcp aqua path by @monotek in [#9357](#9357) ### 📚 Documentation - update ruby compile msg by @fladson in [#9338](#9338) ### 📦️ Dependency Updates - update ubuntu docker tag to v26 by @renovate[bot] in [#9347](#9347) - update ghcr.io/jdx/mise:deb docker digest to 1af5a69 by @renovate[bot] in [#9352](#9352) - update taiki-e/install-action digest to 787505c by @renovate[bot] in [#9354](#9354) - update ghcr.io/jdx/mise:rpm docker digest to 7015ff3 by @renovate[bot] in [#9353](#9353) - update ghcr.io/jdx/mise:copr docker digest to da63a0f by @renovate[bot] in [#9351](#9351) - update ghcr.io/jdx/mise:alpine docker digest to 461700f by @renovate[bot] in [#9350](#9350) - bump communique 1.0.3 → 1.0.4 by @jdx in [#9378](#9378) ### 📦 Registry - remove openshift-install by @jdx in [#9372](#9372) - remove go-sdk by @jdx in [#9371](#9371) ### Chore - **(npm-publish)** use aube publish instead of npm publish by @jdx in [#9328](#9328) ### New Contributors - @fladson made their first contribution in [#9338](#9338)
Addresses issues with new packaging of Zulu Java versions for macOS as mentioned in #9337